planche 0.7.18 → 0.7.20
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/THIRD-PARTY-NOTICES.md +269 -1
- package/app/assets/AboutDialog-dKk703-Z.js +1 -0
- package/app/assets/BigInteger-BlV0QR66.js +1 -0
- package/app/assets/ConnectDialog-DdXULzdj.js +1 -0
- package/app/assets/CopyDatabaseDialog-B7w3Ek74.js +1 -0
- package/app/assets/CopyTableDialog-B0kK-0Bl.js +1 -0
- package/app/assets/CreateDatabaseDialog-Dnulabm5.js +1 -0
- package/app/assets/CreateSchemaDialog-Lvff6Tdj.js +1 -0
- package/app/assets/DataDiffDialog-DNTu-7-T.js +1 -0
- package/app/assets/{DownloadToCSVDialog-BC6Sq8Ce.js → DownloadToCSVDialog-jxCkzB3J.js} +2 -2
- package/app/assets/EditSchemaDialog-CFrD-8z9.js +2 -0
- package/app/assets/FindReplaceDialog-CyNlKq00.js +1 -0
- package/app/assets/{FlushDialog-BX0F3dJQ.js → FlushDialog-Cp7W6Ck1.js} +1 -1
- package/app/assets/GroupByDialog-CHwsURs9.js +1 -0
- package/app/assets/LicenseDialog-RY0SOUb1.js +1 -0
- package/app/assets/LinkColumnDialog-BD9rpsyg.js +1 -0
- package/app/assets/LocalHistoryDialog-LnF86KJl.js +1 -0
- package/app/assets/ProcessListDialog-Jt-1b88E.js +1 -0
- package/app/assets/QuickCommandPalette-DEFuPaG7.js +1 -0
- package/app/assets/RowFormDialog-mM6FFZQr.js +2 -0
- package/app/assets/SafetySettingsDialog-B3MafT1S.js +1 -0
- package/app/assets/SchemaDiffDialog-BvNzQo5m.js +7 -0
- package/app/assets/{SchemaToHTMLDialog-DjZQwEbM.js → SchemaToHTMLDialog-Da8c-rAe.js} +2 -2
- package/app/assets/StatusDialog-mibIDpmA.js +1 -0
- package/app/assets/SyncDialog-BIDs_FZr.js +1 -0
- package/app/assets/{TermsDialog-B53To0oi.js → TermsDialog-CWw3XSw0.js} +1 -1
- package/app/assets/UserAddDialog-D-TQNCsa.js +1 -0
- package/app/assets/UserManagerDialog-DTxhu0T8.js +1 -0
- package/app/assets/VariablesDialog-CCzXtQQV.js +1 -0
- package/app/assets/app-storage-C_1RLCyI.js +1 -0
- package/app/assets/button-B2EsmMJs.js +1 -0
- package/app/assets/chevron-up-CBnVjNE1.js +1 -0
- package/app/assets/connection-store-Ds9Gjt3K.js +1 -0
- package/app/assets/contract-D2InX341.js +1 -0
- package/app/assets/database-eJWHFM-2.js +1 -0
- package/app/assets/de-D9wNOTjH.js +2 -0
- package/app/assets/dialog-FBpgH0QJ.js +1 -0
- package/app/assets/dist-BUXw8brT.js +1 -0
- package/app/assets/dist-BYhFWvmC.js +41 -0
- package/app/assets/dist-BrzYmjQV.js +1 -0
- package/app/assets/dist-C2vlTGNz.js +1 -0
- package/app/assets/editor-registry-ukUyoekH.js +1 -0
- package/app/assets/{engine-CpwlM_Ww.js → engine-DtZy_Zk0.js} +1 -1
- package/app/assets/fr-CMT9T7_Z.js +2 -0
- package/app/assets/hmr-singleton-Bit0Kfog.js +1 -0
- package/app/assets/i18n-BAv7QdV3.js +2 -0
- package/app/assets/ja-C5Z0_8jZ.js +2 -0
- package/app/assets/ko-BF4ZzLce.js +2 -0
- package/app/assets/license-store-BfuSb6KZ.js +1 -0
- package/app/assets/{main-BLydvBDF.js → main-BPskUSLM.js} +198 -197
- package/app/assets/main-DmICiyzI.css +2 -0
- package/app/assets/mariadb-BT1adDMU.js +17 -0
- package/app/assets/mysql-BEg8tI_S.js +17 -0
- package/app/assets/postgresql-erqhE-5Q.js +19 -0
- package/app/assets/pro-gate-IRkx6bbE.js +1 -0
- package/app/assets/pro-upsell-lFmxmise.js +1 -0
- package/app/assets/pro-usage-WSD_KOk4.js +1 -0
- package/app/assets/query-execution-C5QxvBZj.js +7 -0
- package/app/assets/query-store-BR6Saeed.js +1 -0
- package/app/assets/rolldown-runtime-hePW80VL.js +1 -0
- package/app/assets/select-C3A-RS4G.js +1 -0
- package/app/assets/settings-store-CSMhaLcw.js +1 -0
- package/app/assets/table-copy-BJBmJ9OO.js +1 -0
- package/app/assets/transactsql-BVCsopZt.js +16 -0
- package/app/assets/tunneling-rujGqkfQ.js +1 -0
- package/app/assets/ui-store-5IssrgmG.js +1 -0
- package/app/assets/{use-engine-B9GBHTL_.js → use-engine-CxcEyIko.js} +1 -1
- package/app/assets/{user-store-l9ZslFwK.js → user-store-DOy2VMsT.js} +1 -1
- package/app/assets/zh-BpFgSEeR.js +2 -0
- package/app/index.html +29 -20
- package/app/landing.css +96 -0
- package/app/third-party-notices.txt +269 -1
- package/dist/index.js +95 -19
- package/package.json +1 -1
- package/app/assets/AboutDialog-BaQAZjtT.js +0 -1
- package/app/assets/ConnectDialog-BmJvDi1P.js +0 -1
- package/app/assets/CopyDatabaseDialog-BEM-56Og.js +0 -1
- package/app/assets/CopyTableDialog-C2r7l2Ck.js +0 -1
- package/app/assets/CreateDatabaseDialog-CZhIpgiO.js +0 -1
- package/app/assets/CreateSchemaDialog-CNq4nZum.js +0 -1
- package/app/assets/DataDiffDialog-mUg2rIWn.js +0 -1
- package/app/assets/EditSchemaDialog-B0dCI4Lb.js +0 -2
- package/app/assets/FindReplaceDialog-DXJp2TN6.js +0 -1
- package/app/assets/GroupByDialog-BQPTetJF.js +0 -1
- package/app/assets/LinkColumnDialog-BEuhj8o8.js +0 -1
- package/app/assets/LocalHistoryDialog-BGF91HKS.js +0 -1
- package/app/assets/ProcessListDialog-VezdyrHo.js +0 -1
- package/app/assets/QuickCommandPalette-BseiwcpU.js +0 -1
- package/app/assets/RowFormDialog-XRuG3rMt.js +0 -2
- package/app/assets/SafetySettingsDialog-Zh_a4nml.js +0 -1
- package/app/assets/SchemaDiffDialog-BrnruiVP.js +0 -7
- package/app/assets/StatusDialog-a7NhoFvt.js +0 -1
- package/app/assets/UserAddDialog-BBYoKeBv.js +0 -1
- package/app/assets/UserManagerDialog-BPC_IoO6.js +0 -1
- package/app/assets/VariablesDialog-CzHDGRpy.js +0 -1
- package/app/assets/button--s6nUzD8.js +0 -1
- package/app/assets/chevron-up-QmvRX9Fw.js +0 -1
- package/app/assets/connection-store-N-ZwIkVg.js +0 -1
- package/app/assets/database-CpQt6YGv.js +0 -1
- package/app/assets/de-Ci_btQN-.js +0 -2
- package/app/assets/dialog-CJoWJzRo.js +0 -1
- package/app/assets/dist-BAFbxkKh.js +0 -1
- package/app/assets/dist-CBYDYlja.js +0 -41
- package/app/assets/dist-DgJHEXPr.js +0 -1
- package/app/assets/dist-pKt0y9E-.js +0 -1
- package/app/assets/editor-registry-DhF4Rf_I.js +0 -1
- package/app/assets/fr-rLx93rAO.js +0 -2
- package/app/assets/hmr-singleton-DWC1xbJ4.js +0 -1
- package/app/assets/i18n-57fo5jb0.js +0 -2
- package/app/assets/ja-DkiQpTGb.js +0 -2
- package/app/assets/ko-DHI7mstP.js +0 -2
- package/app/assets/main-DX7Tr5cg.css +0 -2
- package/app/assets/pro-usage-VxPxjJqt.js +0 -1
- package/app/assets/query-execution-4-JHu9gp.js +0 -7
- package/app/assets/select-ibmUj7AE.js +0 -1
- package/app/assets/settings-store-WUA0-UcP.js +0 -1
- package/app/assets/table-copy-C1ivtmj8.js +0 -1
- package/app/assets/ui-store-DfspmPOn.js +0 -1
- package/app/assets/zh-mgKu2Zwj.js +0 -2
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -5,7 +5,7 @@ own license, reproduced here in full. Nothing in the Planche License Agreement
|
|
|
5
5
|
limits the rights those licenses grant you.
|
|
6
6
|
|
|
7
7
|
Generated from the production dependencies of the web application.
|
|
8
|
-
|
|
8
|
+
108 packages.
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
@@ -2058,6 +2058,34 @@ SOFTWARE.
|
|
|
2058
2058
|
|
|
2059
2059
|
---
|
|
2060
2060
|
|
|
2061
|
+
## @types/pegjs 0.10.6
|
|
2062
|
+
License: MIT
|
|
2063
|
+
Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pegjs
|
|
2064
|
+
|
|
2065
|
+
MIT License
|
|
2066
|
+
|
|
2067
|
+
Copyright (c) Microsoft Corporation.
|
|
2068
|
+
|
|
2069
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2070
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
2071
|
+
in the Software without restriction, including without limitation the rights
|
|
2072
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
2073
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
2074
|
+
furnished to do so, subject to the following conditions:
|
|
2075
|
+
|
|
2076
|
+
The above copyright notice and this permission notice shall be included in all
|
|
2077
|
+
copies or substantial portions of the Software.
|
|
2078
|
+
|
|
2079
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
2080
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
2081
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
2082
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
2083
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
2084
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
2085
|
+
SOFTWARE
|
|
2086
|
+
|
|
2087
|
+
---
|
|
2088
|
+
|
|
2061
2089
|
## aria-hidden 1.2.6
|
|
2062
2090
|
License: MIT
|
|
2063
2091
|
Homepage: https://github.com/theKashey/aria-hidden#readme
|
|
@@ -2087,6 +2115,37 @@ SOFTWARE.
|
|
|
2087
2115
|
|
|
2088
2116
|
---
|
|
2089
2117
|
|
|
2118
|
+
## big-integer 1.6.52
|
|
2119
|
+
License: Unlicense
|
|
2120
|
+
Author: Peter Olson <peter.e.c.olson+npm@gmail.com>
|
|
2121
|
+
|
|
2122
|
+
This is free and unencumbered software released into the public domain.
|
|
2123
|
+
|
|
2124
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
2125
|
+
distribute this software, either in source code form or as a compiled
|
|
2126
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
2127
|
+
means.
|
|
2128
|
+
|
|
2129
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
2130
|
+
of this software dedicate any and all copyright interest in the
|
|
2131
|
+
software to the public domain. We make this dedication for the benefit
|
|
2132
|
+
of the public at large and to the detriment of our heirs and
|
|
2133
|
+
successors. We intend this dedication to be an overt act of
|
|
2134
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
2135
|
+
software under copyright law.
|
|
2136
|
+
|
|
2137
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
2138
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
2139
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
2140
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
2141
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
2142
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
2143
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
2144
|
+
|
|
2145
|
+
For more information, please refer to <http://unlicense.org>
|
|
2146
|
+
|
|
2147
|
+
---
|
|
2148
|
+
|
|
2090
2149
|
## class-variance-authority 0.7.1
|
|
2091
2150
|
License: Apache-2.0
|
|
2092
2151
|
Homepage: https://github.com/joe-bell/cva#readme
|
|
@@ -3205,6 +3264,215 @@ SOFTWARE.
|
|
|
3205
3264
|
|
|
3206
3265
|
---
|
|
3207
3266
|
|
|
3267
|
+
## node-sql-parser 5.4.0
|
|
3268
|
+
License: Apache-2.0
|
|
3269
|
+
Homepage: https://github.com/taozhi8833998/node-sql-parser#readme
|
|
3270
|
+
Author: taozhi8833998 <taozhi8833998@163.com>
|
|
3271
|
+
|
|
3272
|
+
Apache License
|
|
3273
|
+
Version 2.0, January 2004
|
|
3274
|
+
http://www.apache.org/licenses/
|
|
3275
|
+
|
|
3276
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
3277
|
+
|
|
3278
|
+
1. Definitions.
|
|
3279
|
+
|
|
3280
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
3281
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
3282
|
+
|
|
3283
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
3284
|
+
the copyright owner that is granting the License.
|
|
3285
|
+
|
|
3286
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
3287
|
+
other entities that control, are controlled by, or are under common
|
|
3288
|
+
control with that entity. For the purposes of this definition,
|
|
3289
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
3290
|
+
direction or management of such entity, whether by contract or
|
|
3291
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
3292
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
3293
|
+
|
|
3294
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
3295
|
+
exercising permissions granted by this License.
|
|
3296
|
+
|
|
3297
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
3298
|
+
including but not limited to software source code, documentation
|
|
3299
|
+
source, and configuration files.
|
|
3300
|
+
|
|
3301
|
+
"Object" form shall mean any form resulting from mechanical
|
|
3302
|
+
transformation or translation of a Source form, including but
|
|
3303
|
+
not limited to compiled object code, generated documentation,
|
|
3304
|
+
and conversions to other media types.
|
|
3305
|
+
|
|
3306
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
3307
|
+
Object form, made available under the License, as indicated by a
|
|
3308
|
+
copyright notice that is included in or attached to the work
|
|
3309
|
+
(an example is provided in the Appendix below).
|
|
3310
|
+
|
|
3311
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
3312
|
+
form, that is based on (or derived from) the Work and for which the
|
|
3313
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
3314
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
3315
|
+
of this License, Derivative Works shall not include works that remain
|
|
3316
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
3317
|
+
the Work and Derivative Works thereof.
|
|
3318
|
+
|
|
3319
|
+
"Contribution" shall mean any work of authorship, including
|
|
3320
|
+
the original version of the Work and any modifications or additions
|
|
3321
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
3322
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
3323
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
3324
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
3325
|
+
means any form of electronic, verbal, or written communication sent
|
|
3326
|
+
to the Licensor or its representatives, including but not limited to
|
|
3327
|
+
communication on electronic mailing lists, source code control systems,
|
|
3328
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
3329
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
3330
|
+
excluding communication that is conspicuously marked or otherwise
|
|
3331
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
3332
|
+
|
|
3333
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
3334
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
3335
|
+
subsequently incorporated within the Work.
|
|
3336
|
+
|
|
3337
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
3338
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
3339
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
3340
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
3341
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
3342
|
+
Work and such Derivative Works in Source or Object form.
|
|
3343
|
+
|
|
3344
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
3345
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
3346
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
3347
|
+
(except as stated in this section) patent license to make, have made,
|
|
3348
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
3349
|
+
where such license applies only to those patent claims licensable
|
|
3350
|
+
by such Contributor that are necessarily infringed by their
|
|
3351
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
3352
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
3353
|
+
institute patent litigation against any entity (including a
|
|
3354
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
3355
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
3356
|
+
or contributory patent infringement, then any patent licenses
|
|
3357
|
+
granted to You under this License for that Work shall terminate
|
|
3358
|
+
as of the date such litigation is filed.
|
|
3359
|
+
|
|
3360
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
3361
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
3362
|
+
modifications, and in Source or Object form, provided that You
|
|
3363
|
+
meet the following conditions:
|
|
3364
|
+
|
|
3365
|
+
(a) You must give any other recipients of the Work or
|
|
3366
|
+
Derivative Works a copy of this License; and
|
|
3367
|
+
|
|
3368
|
+
(b) You must cause any modified files to carry prominent notices
|
|
3369
|
+
stating that You changed the files; and
|
|
3370
|
+
|
|
3371
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
3372
|
+
that You distribute, all copyright, patent, trademark, and
|
|
3373
|
+
attribution notices from the Source form of the Work,
|
|
3374
|
+
excluding those notices that do not pertain to any part of
|
|
3375
|
+
the Derivative Works; and
|
|
3376
|
+
|
|
3377
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
3378
|
+
distribution, then any Derivative Works that You distribute must
|
|
3379
|
+
include a readable copy of the attribution notices contained
|
|
3380
|
+
within such NOTICE file, excluding those notices that do not
|
|
3381
|
+
pertain to any part of the Derivative Works, in at least one
|
|
3382
|
+
of the following places: within a NOTICE text file distributed
|
|
3383
|
+
as part of the Derivative Works; within the Source form or
|
|
3384
|
+
documentation, if provided along with the Derivative Works; or,
|
|
3385
|
+
within a display generated by the Derivative Works, if and
|
|
3386
|
+
wherever such third-party notices normally appear. The contents
|
|
3387
|
+
of the NOTICE file are for informational purposes only and
|
|
3388
|
+
do not modify the License. You may add Your own attribution
|
|
3389
|
+
notices within Derivative Works that You distribute, alongside
|
|
3390
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
3391
|
+
that such additional attribution notices cannot be construed
|
|
3392
|
+
as modifying the License.
|
|
3393
|
+
|
|
3394
|
+
You may add Your own copyright statement to Your modifications and
|
|
3395
|
+
may provide additional or different license terms and conditions
|
|
3396
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
3397
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
3398
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
3399
|
+
the conditions stated in this License.
|
|
3400
|
+
|
|
3401
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
3402
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
3403
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
3404
|
+
this License, without any additional terms or conditions.
|
|
3405
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
3406
|
+
the terms of any separate license agreement you may have executed
|
|
3407
|
+
with Licensor regarding such Contributions.
|
|
3408
|
+
|
|
3409
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
3410
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
3411
|
+
except as required for reasonable and customary use in describing the
|
|
3412
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
3413
|
+
|
|
3414
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
3415
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
3416
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
3417
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
3418
|
+
implied, including, without limitation, any warranties or conditions
|
|
3419
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
3420
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
3421
|
+
appropriateness of using or redistributing the Work and assume any
|
|
3422
|
+
risks associated with Your exercise of permissions under this License.
|
|
3423
|
+
|
|
3424
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
3425
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
3426
|
+
unless required by applicable law (such as deliberate and grossly
|
|
3427
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
3428
|
+
liable to You for damages, including any direct, indirect, special,
|
|
3429
|
+
incidental, or consequential damages of any character arising as a
|
|
3430
|
+
result of this License or out of the use or inability to use the
|
|
3431
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
3432
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
3433
|
+
other commercial damages or losses), even if such Contributor
|
|
3434
|
+
has been advised of the possibility of such damages.
|
|
3435
|
+
|
|
3436
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
3437
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
3438
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
3439
|
+
or other liability obligations and/or rights consistent with this
|
|
3440
|
+
License. However, in accepting such obligations, You may act only
|
|
3441
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
3442
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
3443
|
+
defend, and hold each Contributor harmless for any liability
|
|
3444
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
3445
|
+
of your accepting any such warranty or additional liability.
|
|
3446
|
+
|
|
3447
|
+
END OF TERMS AND CONDITIONS
|
|
3448
|
+
|
|
3449
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
3450
|
+
|
|
3451
|
+
To apply the Apache License to your work, attach the following
|
|
3452
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
3453
|
+
replaced with your own identifying information. (Don't include
|
|
3454
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
3455
|
+
comment syntax for the file format. We also recommend that a
|
|
3456
|
+
file or class name and description of purpose be included on the
|
|
3457
|
+
same "printed page" as the copyright notice for easier
|
|
3458
|
+
identification within third-party archives.
|
|
3459
|
+
|
|
3460
|
+
Copyright {yyyy} {name of copyright owner}
|
|
3461
|
+
|
|
3462
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
3463
|
+
you may not use this file except in compliance with the License.
|
|
3464
|
+
You may obtain a copy of the License at
|
|
3465
|
+
|
|
3466
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
3467
|
+
|
|
3468
|
+
Unless required by applicable law or agreed to in writing, software
|
|
3469
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
3470
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3471
|
+
See the License for the specific language governing permissions and
|
|
3472
|
+
limitations under the License.
|
|
3473
|
+
|
|
3474
|
+
---
|
|
3475
|
+
|
|
3208
3476
|
## radix-ui 1.6.7
|
|
3209
3477
|
License: MIT
|
|
3210
3478
|
Homepage: https://radix-ui.com/primitives
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./main-BPskUSLM.js";import{n as t}from"./ui-store-5IssrgmG.js";import{l as n,m as r,t as i}from"./button-B2EsmMJs.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./dialog-FBpgH0QJ.js";var d=n(),f=`https://planche.dev`,p=`/third-party-notices.txt`;function m(){let n=t(e=>e.activeDialog),m=t(e=>e.closeDialog),{t:h}=r();return(0,d.jsx)(u,{open:n===`about`,onOpenChange:e=>{e||m()},children:(0,d.jsxs)(s,{className:`sm:max-w-[440px]`,children:[(0,d.jsx)(a,{children:(0,d.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,d.jsx)(e,{size:44,className:`shrink-0`}),(0,d.jsxs)(`div`,{className:`grid gap-1`,children:[(0,d.jsx)(c,{children:h(`about.title`)}),(0,d.jsx)(l,{children:h(`about.tagline`)})]})]})}),(0,d.jsxs)(`div`,{className:`grid gap-3 text-sm`,children:[(0,d.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1`,children:[(0,d.jsx)(`dt`,{className:`text-muted-foreground`,children:h(`about.version`)}),(0,d.jsx)(`dd`,{children:`0.1.1`}),(0,d.jsx)(`dt`,{className:`text-muted-foreground`,children:h(`about.website`)}),(0,d.jsx)(`dd`,{children:(0,d.jsx)(`a`,{href:f,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:f})}),(0,d.jsx)(`dt`,{className:`text-muted-foreground`,children:h(`about.licenses`)}),(0,d.jsx)(`dd`,{children:(0,d.jsx)(`a`,{href:p,target:`_blank`,rel:`noreferrer`,className:`underline underline-offset-2`,children:h(`about.licensesLink`)})})]}),(0,d.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`© 2026 Juwon Jeong. `,h(`about.rights`)]}),(0,d.jsx)(`p`,{className:`rounded-md border bg-muted/40 p-3 text-xs text-muted-foreground`,children:h(`about.disclaimer`)}),(0,d.jsxs)(`div`,{className:`rounded-md border border-amber-500/40 bg-amber-500/5 p-3 text-xs text-muted-foreground`,children:[(0,d.jsx)(`p`,{className:`mb-1 font-medium text-amber-600 dark:text-amber-400`,children:h(`pro.noticeTitle`)}),(0,d.jsx)(`p`,{children:h(`pro.notice`)})]})]}),(0,d.jsx)(o,{children:(0,d.jsx)(i,{onClick:m,children:h(`settings.done`)})})]})})}export{m as AboutDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-hePW80VL.js";var t=e(((e,t)=>{var n=(function(e){var t=1e7,r=9007199254740992,i=f(r),a=`0123456789abcdefghijklmnopqrstuvwxyz`,o=typeof BigInt==`function`;function s(e,t,n,r){return e===void 0?s[0]:t===void 0||+t==10&&!n?Q(e):re(e,t,n,r)}function c(e,t){this.value=e,this.sign=t,this.isSmall=!1}c.prototype=Object.create(s.prototype);function l(e){this.value=e,this.sign=e<0,this.isSmall=!0}l.prototype=Object.create(s.prototype);function u(e){this.value=e}u.prototype=Object.create(s.prototype);function d(e){return-r<e&&e<r}function f(e){return e<1e7?[e]:e<0x5af3107a4000?[e%1e7,Math.floor(e/1e7)]:[e%1e7,Math.floor(e/1e7)%1e7,Math.floor(e/0x5af3107a4000)]}function p(e){m(e);var n=e.length;if(n<4&&M(e,i)<0)switch(n){case 0:return 0;case 1:return e[0];case 2:return e[0]+e[1]*t;default:return e[0]+(e[1]+e[2]*t)*t}return e}function m(e){for(var t=e.length;e[--t]===0;);e.length=t+1}function h(e){for(var t=Array(e),n=-1;++n<e;)t[n]=0;return t}function g(e){return e>0?Math.floor(e):Math.ceil(e)}function _(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(l=0;l<i;l++)c=e[l]+n[l]+o,o=+(c>=s),a[l]=c-o*s;for(;l<r;)c=e[l]+o,o=+(c===s),a[l++]=c-o*s;return o>0&&a.push(o),a}function v(e,t){return e.length>=t.length?_(e,t):_(t,e)}function y(e,n){var r=e.length,i=Array(r),a=t,o,s;for(s=0;s<r;s++)o=e[s]-a+n,n=Math.floor(o/a),i[s]=o-n*a,n+=1;for(;n>0;)i[s++]=n%a,n=Math.floor(n/a);return i}c.prototype.add=function(e){var t=Q(e);if(this.sign!==t.sign)return this.subtract(t.negate());var n=this.value,r=t.value;return t.isSmall?new c(y(n,Math.abs(r)),this.sign):new c(v(n,r),this.sign)},c.prototype.plus=c.prototype.add,l.prototype.add=function(e){var t=Q(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(d(n+r))return new l(n+r);r=f(Math.abs(r))}return new c(y(r,Math.abs(n)),n<0)},l.prototype.plus=l.prototype.add,u.prototype.add=function(e){return new u(this.value+Q(e).value)},u.prototype.plus=u.prototype.add;function b(e,n){var r=e.length,i=n.length,a=Array(r),o=0,s=t,c,l;for(c=0;c<i;c++)l=e[c]-o-n[c],l<0?(l+=s,o=1):o=0,a[c]=l;for(c=i;c<r;c++){if(l=e[c]-o,l<0)l+=s;else{a[c++]=l;break}a[c]=l}for(;c<r;c++)a[c]=e[c];return m(a),a}function x(e,t,n){var r;return M(e,t)>=0?r=b(e,t):(r=b(t,e),n=!n),r=p(r),typeof r==`number`?(n&&(r=-r),new l(r)):new c(r,n)}function S(e,n,r){var i=e.length,a=Array(i),o=-n,s=t,u,d;for(u=0;u<i;u++)d=e[u]+o,o=Math.floor(d/s),d%=s,a[u]=d<0?d+s:d;return a=p(a),typeof a==`number`?(r&&(a=-a),new l(a)):new c(a,r)}c.prototype.subtract=function(e){var t=Q(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?S(n,Math.abs(r),this.sign):x(n,r,this.sign)},c.prototype.minus=c.prototype.subtract,l.prototype.subtract=function(e){var t=Q(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new l(n-r):S(r,Math.abs(n),n>=0)},l.prototype.minus=l.prototype.subtract,u.prototype.subtract=function(e){return new u(this.value-Q(e).value)},u.prototype.minus=u.prototype.subtract,c.prototype.negate=function(){return new c(this.value,!this.sign)},l.prototype.negate=function(){var e=this.sign,t=new l(-this.value);return t.sign=!e,t},u.prototype.negate=function(){return new u(-this.value)},c.prototype.abs=function(){return new c(this.value,!1)},l.prototype.abs=function(){return new l(Math.abs(this.value))},u.prototype.abs=function(){return new u(this.value>=0?this.value:-this.value)};function C(e,n){var r=e.length,i=n.length,a=h(r+i),o=t,s,c,l,u,d;for(l=0;l<r;++l){u=e[l];for(var f=0;f<i;++f)d=n[f],s=u*d+a[l+f],c=Math.floor(s/o),a[l+f]=s-c*o,a[l+f+1]+=c}return m(a),a}function w(e,n){var r=e.length,i=Array(r),a=t,o=0,s,c;for(c=0;c<r;c++)s=e[c]*n+o,o=Math.floor(s/a),i[c]=s-o*a;for(;o>0;)i[c++]=o%a,o=Math.floor(o/a);return i}function T(e,t){for(var n=[];t-->0;)n.push(0);return n.concat(e)}function E(e,t){var n=Math.max(e.length,t.length);if(n<=30)return C(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),a=t.slice(n),o=t.slice(0,n),s=E(i,o),c=E(r,a),l=v(v(s,T(b(b(E(v(i,r),v(o,a)),s),c),n)),T(c,2*n));return m(l),l}function D(e,t){return-.012*e-.012*t+15e-6*e*t>0}c.prototype.multiply=function(e){var n=Q(e),r=this.value,i=n.value,a=this.sign!==n.sign,o;if(n.isSmall){if(i===0)return s[0];if(i===1)return this;if(i===-1)return this.negate();if(o=Math.abs(i),o<t)return new c(w(r,o),a);i=f(o)}return D(r.length,i.length)?new c(E(r,i),a):new c(C(r,i),a)},c.prototype.times=c.prototype.multiply;function O(e,n,r){return e<t?new c(w(n,e),r):new c(C(n,f(e)),r)}l.prototype._multiplyBySmall=function(e){return d(e.value*this.value)?new l(e.value*this.value):O(Math.abs(e.value),f(Math.abs(this.value)),this.sign!==e.sign)},c.prototype._multiplyBySmall=function(e){return e.value===0?s[0]:e.value===1?this:e.value===-1?this.negate():O(Math.abs(e.value),this.value,this.sign!==e.sign)},l.prototype.multiply=function(e){return Q(e)._multiplyBySmall(this)},l.prototype.times=l.prototype.multiply,u.prototype.multiply=function(e){return new u(this.value*Q(e).value)},u.prototype.times=u.prototype.multiply;function k(e){var n=e.length,r=h(n+n),i=t,a,o,s,c,l;for(s=0;s<n;s++){c=e[s],o=0-c*c;for(var u=s;u<n;u++)l=e[u],a=c*l*2+r[s+u]+o,o=Math.floor(a/i),r[s+u]=a-o*i;r[s+n]=o}return m(r),r}c.prototype.square=function(){return new c(k(this.value),!1)},l.prototype.square=function(){var e=this.value*this.value;return d(e)?new l(e):new c(k(f(Math.abs(this.value))),!1)},u.prototype.square=function(e){return new u(this.value*this.value)};function ee(e,n){var r=e.length,i=n.length,a=t,o=h(n.length),s=n[i-1],c=Math.ceil(a/(2*s)),l=w(e,c),u=w(n,c),d,f,m,g,_,v,y;for(l.length<=r&&l.push(0),u.push(0),s=u[i-1],f=r-i;f>=0;f--){for(d=a-1,l[f+i]!==s&&(d=Math.floor((l[f+i]*a+l[f+i-1])/s)),m=0,g=0,v=u.length,_=0;_<v;_++)m+=d*u[_],y=Math.floor(m/a),g+=l[f+_]-(m-y*a),m=y,g<0?(l[f+_]=g+a,g=-1):(l[f+_]=g,g=0);for(;g!==0;){for(--d,m=0,_=0;_<v;_++)m+=l[f+_]-a+u[_],m<0?(l[f+_]=m+a,m=0):(l[f+_]=m,m=1);g+=m}o[f]=d}return l=A(l,c)[0],[p(o),p(l)]}function te(e,n){for(var r=e.length,i=n.length,a=[],o=[],s=t,c,l,u,d,f;r;){if(o.unshift(e[--r]),m(o),M(o,n)<0){a.push(0);continue}l=o.length,u=o[l-1]*s+o[l-2],d=n[i-1]*s+n[i-2],l>i&&(u=(u+1)*s),c=Math.ceil(u/d);do{if(f=w(n,c),M(f,o)<=0)break;c--}while(c);a.push(c),o=b(o,f)}return a.reverse(),[p(a),p(o)]}function A(e,n){var r=e.length,i=h(r),a=t,o,s,c=0,l;for(o=r-1;o>=0;--o)l=c*a+e[o],s=g(l/n),c=l-s*n,i[o]=s|0;return[i,c|0]}function j(e,n){var r,i=Q(n);if(o)return[new u(e.value/i.value),new u(e.value%i.value)];var a=e.value,d=i.value,m;if(d===0)throw Error(`Cannot divide by zero`);if(e.isSmall)return i.isSmall?[new l(g(a/d)),new l(a%d)]:[s[0],e];if(i.isSmall){if(d===1)return[e,s[0]];if(d==-1)return[e.negate(),s[0]];var h=Math.abs(d);if(h<t){r=A(a,h),m=p(r[0]);var _=r[1];return e.sign&&(_=-_),typeof m==`number`?(e.sign!==i.sign&&(m=-m),[new l(m),new l(_)]):[new c(m,e.sign!==i.sign),new l(_)]}d=f(h)}var v=M(a,d);if(v===-1)return[s[0],e];if(v===0)return[s[e.sign===i.sign?1:-1],s[0]];r=a.length+d.length<=200?ee(a,d):te(a,d),m=r[0];var y=e.sign!==i.sign,b=r[1],x=e.sign;return typeof m==`number`?(y&&(m=-m),m=new l(m)):m=new c(m,y),typeof b==`number`?(x&&(b=-b),b=new l(b)):b=new c(b,x),[m,b]}c.prototype.divmod=function(e){var t=j(this,e);return{quotient:t[0],remainder:t[1]}},u.prototype.divmod=l.prototype.divmod=c.prototype.divmod,c.prototype.divide=function(e){return j(this,e)[0]},u.prototype.over=u.prototype.divide=function(e){return new u(this.value/Q(e).value)},l.prototype.over=l.prototype.divide=c.prototype.over=c.prototype.divide,c.prototype.mod=function(e){return j(this,e)[1]},u.prototype.mod=u.prototype.remainder=function(e){return new u(this.value%Q(e).value)},l.prototype.remainder=l.prototype.mod=c.prototype.remainder=c.prototype.mod,c.prototype.pow=function(e){var t=Q(e),n=this.value,r=t.value,i,a,o;if(r===0)return s[1];if(n===0)return s[0];if(n===1)return s[1];if(n===-1)return t.isEven()?s[1]:s[-1];if(t.sign)return s[0];if(!t.isSmall)throw Error(`The exponent `+t.toString()+` is too large.`);if(this.isSmall&&d(i=n**+r))return new l(g(i));for(a=this,o=s[1];r&!0&&(o=o.times(a),--r),r!==0;)r/=2,a=a.square();return o},l.prototype.pow=c.prototype.pow,u.prototype.pow=function(e){var t=Q(e),n=this.value,r=t.value,i=BigInt(0),a=BigInt(1),o=BigInt(2);if(r===i)return s[1];if(n===i)return s[0];if(n===a)return s[1];if(n===BigInt(-1))return t.isEven()?s[1]:s[-1];if(t.isNegative())return new u(i);for(var c=this,l=s[1];(r&a)===a&&(l=l.times(c),--r),r!==i;)r/=o,c=c.square();return l},c.prototype.modPow=function(e,t){if(e=Q(e),t=Q(t),t.isZero())throw Error(`Cannot take modPow with modulus 0`);var n=s[1],r=this.mod(t);for(e.isNegative()&&(e=e.multiply(s[-1]),r=r.modInv(t));e.isPositive();){if(r.isZero())return s[0];e.isOdd()&&(n=n.multiply(r).mod(t)),e=e.divide(2),r=r.square().mod(t)}return n},u.prototype.modPow=l.prototype.modPow=c.prototype.modPow;function M(e,t){if(e.length!==t.length)return e.length>t.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}c.prototype.compareAbs=function(e){var t=Q(e),n=this.value,r=t.value;return t.isSmall?1:M(n,r)},l.prototype.compareAbs=function(e){var t=Q(e),n=Math.abs(this.value),r=t.value;return t.isSmall?(r=Math.abs(r),n===r?0:n>r?1:-1):-1},u.prototype.compareAbs=function(e){var t=this.value,n=Q(e).value;return t=t>=0?t:-t,n=n>=0?n:-n,t===n?0:t>n?1:-1},c.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=Q(e),n=this.value,r=t.value;return this.sign===t.sign?t.isSmall?this.sign?-1:1:M(n,r)*(this.sign?-1:1):t.sign?1:-1},c.prototype.compareTo=c.prototype.compare,l.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=Q(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0===t.sign?n<0?1:-1:n<0?-1:1},l.prototype.compareTo=l.prototype.compare,u.prototype.compare=function(e){if(e===1/0)return-1;if(e===-1/0)return 1;var t=this.value,n=Q(e).value;return t===n?0:t>n?1:-1},u.prototype.compareTo=u.prototype.compare,c.prototype.equals=function(e){return this.compare(e)===0},u.prototype.eq=u.prototype.equals=l.prototype.eq=l.prototype.equals=c.prototype.eq=c.prototype.equals,c.prototype.notEquals=function(e){return this.compare(e)!==0},u.prototype.neq=u.prototype.notEquals=l.prototype.neq=l.prototype.notEquals=c.prototype.neq=c.prototype.notEquals,c.prototype.greater=function(e){return this.compare(e)>0},u.prototype.gt=u.prototype.greater=l.prototype.gt=l.prototype.greater=c.prototype.gt=c.prototype.greater,c.prototype.lesser=function(e){return this.compare(e)<0},u.prototype.lt=u.prototype.lesser=l.prototype.lt=l.prototype.lesser=c.prototype.lt=c.prototype.lesser,c.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},u.prototype.geq=u.prototype.greaterOrEquals=l.prototype.geq=l.prototype.greaterOrEquals=c.prototype.geq=c.prototype.greaterOrEquals,c.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},u.prototype.leq=u.prototype.lesserOrEquals=l.prototype.leq=l.prototype.lesserOrEquals=c.prototype.leq=c.prototype.lesserOrEquals,c.prototype.isEven=function(){return!(this.value[0]&1)},l.prototype.isEven=function(){return!(this.value&1)},u.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},c.prototype.isOdd=function(){return(this.value[0]&1)==1},l.prototype.isOdd=function(){return(this.value&1)==1},u.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},c.prototype.isPositive=function(){return!this.sign},l.prototype.isPositive=function(){return this.value>0},u.prototype.isPositive=l.prototype.isPositive,c.prototype.isNegative=function(){return this.sign},l.prototype.isNegative=function(){return this.value<0},u.prototype.isNegative=l.prototype.isNegative,c.prototype.isUnit=function(){return!1},l.prototype.isUnit=function(){return Math.abs(this.value)===1},u.prototype.isUnit=function(){return this.abs().value===BigInt(1)},c.prototype.isZero=function(){return!1},l.prototype.isZero=function(){return this.value===0},u.prototype.isZero=function(){return this.value===BigInt(0)},c.prototype.isDivisibleBy=function(e){var t=Q(e);return t.isZero()?!1:t.isUnit()?!0:t.compareAbs(2)===0?this.isEven():this.mod(t).isZero()},u.prototype.isDivisibleBy=l.prototype.isDivisibleBy=c.prototype.isDivisibleBy;function N(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(49))return!0}function P(e,t){for(var r=e.prev(),i=r,a=0,o,s,c;i.isEven();)i=i.divide(2),a++;next:for(s=0;s<t.length;s++)if(!e.lesser(t[s])&&(c=n(t[s]).modPow(i,e),!(c.isUnit()||c.equals(r)))){for(o=a-1;o!=0;o--){if(c=c.square().mod(e),c.isUnit())return!1;if(c.equals(r))continue next}return!1}return!0}c.prototype.isPrime=function(t){var r=N(this);if(r!==e)return r;var i=this.abs(),a=i.bitLength();if(a<=64)return P(i,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var o=Math.log(2)*a.toJSNumber(),s=Math.ceil(t===!0?2*o**2:o),c=[],l=0;l<s;l++)c.push(n(l+2));return P(i,c)},u.prototype.isPrime=l.prototype.isPrime=c.prototype.isPrime,c.prototype.isProbablePrime=function(t,r){var i=N(this);if(i!==e)return i;for(var a=this.abs(),o=t===e?5:t,s=[],c=0;c<o;c++)s.push(n.randBetween(2,a.minus(2),r));return P(a,s)},u.prototype.isProbablePrime=l.prototype.isProbablePrime=c.prototype.isProbablePrime,c.prototype.modInv=function(e){for(var t=n.zero,r=n.one,i=Q(e),a=this.abs(),o,s,c;!a.isZero();)o=i.divide(a),s=t,c=i,t=r,i=a,r=s.subtract(o.multiply(r)),a=c.subtract(o.multiply(a));if(!i.isUnit())throw Error(this.toString()+` and `+e.toString()+` are not co-prime`);return t.compare(0)===-1&&(t=t.add(e)),this.isNegative()?t.negate():t},u.prototype.modInv=l.prototype.modInv=c.prototype.modInv,c.prototype.next=function(){var e=this.value;return this.sign?S(e,1,this.sign):new c(y(e,1),this.sign)},l.prototype.next=function(){var e=this.value;return e+1<r?new l(e+1):new c(i,!1)},u.prototype.next=function(){return new u(this.value+BigInt(1))},c.prototype.prev=function(){var e=this.value;return this.sign?new c(y(e,1),!0):S(e,1,this.sign)},l.prototype.prev=function(){var e=this.value;return e-1>-r?new l(e-1):new c(i,!0)},u.prototype.prev=function(){return new u(this.value-BigInt(1))};for(var F=[1];2*F[F.length-1]<=t;)F.push(2*F[F.length-1]);var I=F.length,L=F[I-1];function R(e){return Math.abs(e)<=t}c.prototype.shiftLeft=function(e){var t=Q(e).toJSNumber();if(!R(t))throw Error(String(t)+` is too large for shifting.`);if(t<0)return this.shiftRight(-t);var n=this;if(n.isZero())return n;for(;t>=I;)n=n.multiply(L),t-=I-1;return n.multiply(F[t])},u.prototype.shiftLeft=l.prototype.shiftLeft=c.prototype.shiftLeft,c.prototype.shiftRight=function(e){var t,n=Q(e).toJSNumber();if(!R(n))throw Error(String(n)+` is too large for shifting.`);if(n<0)return this.shiftLeft(-n);for(var r=this;n>=I;){if(r.isZero()||r.isNegative()&&r.isUnit())return r;t=j(r,L),r=t[1].isNegative()?t[0].prev():t[0],n-=I-1}return t=j(r,F[n]),t[1].isNegative()?t[0].prev():t[0]},u.prototype.shiftRight=l.prototype.shiftRight=c.prototype.shiftRight;function z(e,t,r){t=Q(t);for(var i=e.isNegative(),a=t.isNegative(),o=i?e.not():e,s=a?t.not():t,c=0,l=0,u=null,d=null,f=[];!o.isZero()||!s.isZero();)u=j(o,L),c=u[1].toJSNumber(),i&&(c=L-1-c),d=j(s,L),l=d[1].toJSNumber(),a&&(l=L-1-l),o=u[0],s=d[0],f.push(r(c,l));for(var p=r(+!!i,+!!a)===0?n(0):n(-1),m=f.length-1;m>=0;--m)p=p.multiply(L).add(n(f[m]));return p}c.prototype.not=function(){return this.negate().prev()},u.prototype.not=l.prototype.not=c.prototype.not,c.prototype.and=function(e){return z(this,e,function(e,t){return e&t})},u.prototype.and=l.prototype.and=c.prototype.and,c.prototype.or=function(e){return z(this,e,function(e,t){return e|t})},u.prototype.or=l.prototype.or=c.prototype.or,c.prototype.xor=function(e){return z(this,e,function(e,t){return e^t})},u.prototype.xor=l.prototype.xor=c.prototype.xor;var B=1<<30,V=(t&-t)*(t&-t)|B;function H(e){var n=e.value,r=typeof n==`number`?n|B:typeof n==`bigint`?n|BigInt(B):n[0]+n[1]*t|V;return r&-r}function U(e,t){if(t.compareTo(e)<=0){var r=U(e,t.square(t)),i=r.p,a=r.e,o=i.multiply(t);return o.compareTo(e)<=0?{p:o,e:a*2+1}:{p:i,e:a*2}}return{p:n(1),e:0}}c.prototype.bitLength=function(){var e=this;return e.compareTo(n(0))<0&&(e=e.negate().subtract(n(1))),e.compareTo(n(0))===0?n(0):n(U(e,n(2)).e).add(n(1))},u.prototype.bitLength=l.prototype.bitLength=c.prototype.bitLength;function W(e,t){return e=Q(e),t=Q(t),e.greater(t)?e:t}function G(e,t){return e=Q(e),t=Q(t),e.lesser(t)?e:t}function K(e,t){if(e=Q(e).abs(),t=Q(t).abs(),e.equals(t))return e;if(e.isZero())return t;if(t.isZero())return e;for(var n=s[1],r,i;e.isEven()&&t.isEven();)r=G(H(e),H(t)),e=e.divide(r),t=t.divide(r),n=n.multiply(r);for(;e.isEven();)e=e.divide(H(e));do{for(;t.isEven();)t=t.divide(H(t));e.greater(t)&&(i=t,t=e,e=i),t=t.subtract(e)}while(!t.isZero());return n.isUnit()?e:e.multiply(n)}function q(e,t){return e=Q(e).abs(),t=Q(t).abs(),e.divide(K(e,t)).multiply(t)}function ne(e,n,r){e=Q(e),n=Q(n);var i=r||Math.random,a=G(e,n),o=W(e,n).subtract(a).add(1);if(o.isSmall)return a.add(Math.floor(i()*o));for(var c=Y(o,t).value,l=[],u=!0,d=0;d<c.length;d++){var f=u?c[d]+(d+1<c.length?c[d+1]/t:0):t,p=g(i()*f);l.push(p),p<c[d]&&(u=!1)}return a.add(s.fromArray(l,t,!1))}var re=function(e,t,n,r){n||=a,e=String(e),r||(e=e.toLowerCase(),n=n.toLowerCase());var i=e.length,o,s=Math.abs(t),c={};for(o=0;o<n.length;o++)c[n[o]]=o;for(o=0;o<i;o++){var l=e[o];if(l!==`-`&&l in c&&c[l]>=s){if(l===`1`&&s===1)continue;throw Error(l+` is not a valid digit in base `+t+`.`)}}t=Q(t);var u=[],d=e[0]===`-`;for(o=+!!d;o<e.length;o++){var l=e[o];if(l in c)u.push(Q(c[l]));else if(l===`<`){var f=o;do o++;while(e[o]!==`>`&&o<e.length);u.push(Q(e.slice(f+1,o)))}else throw Error(l+` is not a valid character`)}return J(u,t,d)};function J(e,t,n){var r=s[0],i=s[1],a;for(a=e.length-1;a>=0;a--)r=r.add(e[a].times(i)),i=i.times(t);return n?r.negate():r}function ie(e,t){return t||=a,e<t.length?t[e]:`<`+e+`>`}function Y(e,t){if(t=n(t),t.isZero()){if(e.isZero())return{value:[0],isNegative:!1};throw Error(`Cannot convert nonzero numbers to base 0.`)}if(t.equals(-1)){if(e.isZero())return{value:[0],isNegative:!1};if(e.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-e.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(e.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var i=!1;if(e.isNegative()&&t.isPositive()&&(i=!0,e=e.abs()),t.isUnit())return e.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(e.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:i};for(var a=[],o=e,s;o.isNegative()||o.compareAbs(t)>=0;){s=o.divmod(t),o=s.quotient;var c=s.remainder;c.isNegative()&&(c=t.minus(c).abs(),o=o.next()),a.push(c.toJSNumber())}return a.push(o.toJSNumber()),{value:a.reverse(),isNegative:i}}function X(e,t,n){var r=Y(e,t);return(r.isNegative?`-`:``)+r.value.map(function(e){return ie(e,n)}).join(``)}c.prototype.toArray=function(e){return Y(this,e)},l.prototype.toArray=function(e){return Y(this,e)},u.prototype.toArray=function(e){return Y(this,e)},c.prototype.toString=function(t,n){if(t===e&&(t=10),t!==10||n)return X(this,t,n);for(var r=this.value,i=r.length,a=String(r[--i]),o=`0000000`,s;--i>=0;)s=String(r[i]),a+=o.slice(s.length)+s;return(this.sign?`-`:``)+a},l.prototype.toString=function(t,n){return t===e&&(t=10),t!=10||n?X(this,t,n):String(this.value)},u.prototype.toString=l.prototype.toString,u.prototype.toJSON=c.prototype.toJSON=l.prototype.toJSON=function(){return this.toString()},c.prototype.valueOf=function(){return parseInt(this.toString(),10)},c.prototype.toJSNumber=c.prototype.valueOf,l.prototype.valueOf=function(){return this.value},l.prototype.toJSNumber=l.prototype.valueOf,u.prototype.valueOf=u.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function Z(e){if(d(+e)){var t=+e;if(t===g(t))return o?new u(BigInt(t)):new l(t);throw Error(`Invalid integer: `+e)}var n=e[0]===`-`;n&&(e=e.slice(1));var r=e.split(/e/i);if(r.length>2)throw Error(`Invalid integer: `+r.join(`e`));if(r.length===2){var i=r[1];if(i[0]===`+`&&(i=i.slice(1)),i=+i,i!==g(i)||!d(i))throw Error(`Invalid integer: `+i+` is not a valid exponent.`);var a=r[0],s=a.indexOf(`.`);if(s>=0&&(i-=a.length-s-1,a=a.slice(0,s)+a.slice(s+1)),i<0)throw Error(`Cannot include negative exponent part for integers`);a+=Array(i+1).join(`0`),e=a}if(!/^([0-9][0-9]*)$/.test(e))throw Error(`Invalid integer: `+e);if(o)return new u(BigInt(n?`-`+e:e));for(var f=[],p=e.length,h=7,_=p-h;p>0;)f.push(+e.slice(_,p)),_-=h,_<0&&(_=0),p-=h;return m(f),new c(f,n)}function ae(e){if(o)return new u(BigInt(e));if(d(e)){if(e!==g(e))throw Error(e+` is not an integer.`);return new l(e)}return Z(e.toString())}function Q(e){return typeof e==`number`?ae(e):typeof e==`string`?Z(e):typeof e==`bigint`?new u(e):e}for(var $=0;$<1e3;$++)s[$]=Q($),$>0&&(s[-$]=Q(-$));return s.one=s[1],s.zero=s[0],s.minusOne=s[-1],s.max=W,s.min=G,s.gcd=K,s.lcm=q,s.isInstance=function(e){return e instanceof c||e instanceof l||e instanceof u},s.randBetween=ne,s.fromArray=function(e,t,n){return J(e.map(Q),Q(t||10),n)},s})();t!==void 0&&t.hasOwnProperty(`exports`)&&(t.exports=n),typeof define==`function`&&define.amd&&define(function(){return n})}));export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,L as r,M as i,R as a,S as o,a as s,b as c,c as l,i as u,j as d,l as f,n as p,o as m,ot as h,r as g,s as _,u as v,v as y,x as b,y as x}from"./main-BPskUSLM.js";import{h as S,n as C,t as w}from"./ui-store-5IssrgmG.js";import{l as T,m as E,t as D}from"./button-B2EsmMJs.js";import{a as O,i as k,n as A,r as j,t as M}from"./select-C3A-RS4G.js";import{t as N}from"./connection-store-Ds9Gjt3K.js";import{n as P}from"./query-store-BR6Saeed.js";import{n as F}from"./pro-gate-IRkx6bbE.js";import{g as I,h as L,i as ee,l as te,u as ne,v as R}from"./tunneling-rujGqkfQ.js";import{S as re,d as z,g as ie,i as ae,l as B,r as oe}from"./database-eJWHFM-2.js";import{n as V,t as H}from"./dbms-BwnatOMe.js";import{a as se,i as ce,n as le,o as ue,t as de}from"./dialog-FBpgH0QJ.js";var U=e(S(),1),W=new Set([`postgres:`,`postgresql:`]);function G(e){let t=e.trim().replace(/^psql\s+(['"])?/,``).replace(/['"]$/,``);if(!/^postgres(ql)?:\/\//i.test(t))return null;let n;try{n=new URL(t)}catch{return null}if(!W.has(n.protocol.toLowerCase())||!n.hostname)return null;let r=e=>{try{return decodeURIComponent(e)}catch{return e}},i={host:n.hostname};n.port&&(i.port=Number(n.port)),n.username&&(i.user=r(n.username)),n.password&&(i.pass=r(n.password));let a=r(n.pathname.replace(/^\//,``));return a&&(i.database=a),i}var K=new Set([`localhost`,`127.0.0.1`,`[::1]`,`::1`,`0.0.0.0`]);async function q(e,t){let n;try{let t=new URL(e);if(!K.has(t.hostname.toLowerCase()))return[];n=t.origin}catch{return[]}try{let e=await fetch(`${n}/cdn-cgi/local/explorer/api/d1/database`,{signal:t});if(!e.ok)return[];let r=await e.json(),i=new Map;for(let e of r.result??[])e.uuid&&i.set(e.uuid,{name:e.name??e.uuid,id:e.uuid});return[...i.values()]}catch{return[]}}var J=T(),Y=[`utf8`,`utf8mb4`,`latin1`,`ascii`,`euckr`,`sjis`,`big5`],X={enabled:!1,host:``,port:22,user:``,auth:`key`};function Z({label:e,htmlFor:t,children:n}){return(0,J.jsxs)(`div`,{className:`grid grid-cols-[120px_minmax(0,1fr)] items-center gap-2`,children:[(0,J.jsx)(l,{htmlFor:t,children:e}),n]})}function fe({value:e,onChange:t}){let{t:n}=E();function r(n,r){t({...e,[n]:r})}let[o,s]=(0,U.useState)([]),c=e.dbms===`d1`?e.devUrl??``:``;(0,U.useEffect)(()=>{if(!c){s([]);return}let e=new AbortController,t=setTimeout(()=>{q(c,e.signal).then(s)},300);return()=>{clearTimeout(t),e.abort()}},[c]);let l=e.dbms===`sqlite`,u=e.transport??`browser`,p=l&&u===`browser`,h=I.has(e.dbms),g=e.dbms===`d1`,y=e.dbms===`do`,b=H.find(t=>t.id===e.dbms)?.capabilities,x=e.ssh??X,[S,C]=(0,U.useState)(``),w=S.trim()===``?`empty`:G(S)?`applied`:`invalid`,T=e.dbms===`supabase`&&e.port===6543;function N(n){C(n);let r=G(n);r&&t({...e,host:r.host??e.host,port:r.port??H.find(t=>t.id===e.dbms)?.defaultPort??e.port,user:r.user??e.user,pass:r.pass??e.pass,database:r.database??e.database})}function P(n){t({...e,ssh:{...x,...n}})}async function L(e){e&&P({privateKey:await e.text(),privateKeyName:e.name})}return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,J.jsx)(Z,{label:n(`connection.form.hostName`),htmlFor:`conn-hostName`,children:(0,J.jsx)(f,{id:`conn-hostName`,placeholder:n(`connection.form.hostNamePlaceholder`),value:e.hostName,onChange:e=>r(`hostName`,e.target.value)})}),(0,J.jsx)(Z,{label:n(`connection.form.dataSource`),children:(0,J.jsxs)(M,{value:e.dbms,onValueChange:n=>{let r=H.find(e=>e.id===n);if(!r)return;let i=r.id,a=I.has(i)||i===`d1`||i===`do`;C(``),t({...e,dbms:i,transactionMode:r.capabilities.transactions?e.transactionMode:`auto`,port:r.defaultPort??e.port,host:a&&e.host===`localhost`?``:!a&&e.host===``?`localhost`:e.host,user:a||h||g||y?_(i):e.user,devUrl:i===`do`?e.devUrl||`http://localhost:8787`:e.devUrl,database:e.database&&!a&&!h&&!g&&!y?e.database:m(i)??e.database})},children:[(0,J.jsx)(k,{id:`conn-dbms`,className:`w-full`,children:(0,J.jsx)(O,{})}),(0,J.jsx)(A,{children:H.map(e=>(0,J.jsx)(j,{value:e.id,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(v,{dbms:e.id}),e.label]})},e.id))})]})}),h&&(0,J.jsx)(Z,{label:n(`connection.form.connectionString`),htmlFor:`conn-uri`,children:(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsx)(f,{id:`conn-uri`,type:`password`,autoComplete:`new-password`,spellCheck:!1,className:`font-mono text-xs`,placeholder:e.dbms===`neon`?`postgresql://neondb_owner:npg_…@ep-….neon.tech/neondb?sslmode=require`:`postgresql://postgres.[ref]:[password]@aws-0-….pooler.supabase.com:5432/postgres`,value:S,onChange:e=>N(e.target.value)}),(0,J.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed ${w===`invalid`?`text-destructive`:`text-muted-foreground`}`,children:n(w===`invalid`?`connection.form.connectionStringInvalid`:w===`applied`?`connection.form.connectionStringApplied`:e.dbms===`neon`?`connection.form.neonHint`:`connection.form.supabaseHint`)})]})}),l&&(0,J.jsxs)(Z,{label:n(`connection.form.openVia`),children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,J.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm cursor-pointer`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`transport`,value:`browser`,checked:u===`browser`,onChange:()=>r(`transport`,`browser`),className:`accent-primary`}),n(`connection.form.viaBrowser`)]}),(0,J.jsxs)(`label`,{className:`flex items-center gap-1.5 text-sm cursor-pointer`,children:[(0,J.jsx)(`input`,{type:`radio`,name:`transport`,value:`tunnel`,checked:u===`tunnel`,onChange:()=>r(`transport`,`tunnel`),className:`accent-primary`}),n(`connection.form.viaAgent`)]})]}),(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(u===`browser`?`connection.form.viaBrowserHint`:`connection.form.viaAgentHint`)})]}),p?(0,J.jsx)(Z,{label:n(`connection.form.databaseFile`),children:(0,J.jsxs)(`div`,{className:`min-w-0 text-xs text-muted-foreground leading-relaxed`,children:[e.file?(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,J.jsx)(`span`,{className:`min-w-0 break-all text-foreground`,title:e.file,children:e.file}),(0,J.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>{B(e.id),r(`file`,``)},children:n(`connection.form.changeFile`)})]}):(0,J.jsx)(`p`,{children:n(`connection.form.filePickerHint`)}),(0,J.jsx)(`p`,{className:`mt-1`,children:n(`connection.form.fileRememberedHint`)})]})}):null,!p&&(0,J.jsx)(Z,{label:n(`connection.form.authToken`),htmlFor:`conn-authToken`,children:(0,J.jsx)(f,{id:`conn-authToken`,type:`password`,autoComplete:`new-password`,placeholder:n(`connection.form.authTokenPlaceholder`),value:e.authToken,onChange:e=>r(`authToken`,e.target.value.trim())})}),p?null:y?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:n(`connection.form.doDevUrl`),htmlFor:`conn-do-url`,children:(0,J.jsx)(f,{id:`conn-do-url`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`http://localhost:8787`,value:e.devUrl??``,onChange:e=>r(`devUrl`,e.target.value.trim())})}),(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.doHint`)}),(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.doLimitsHint`)})]}):g?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:n(`connection.form.d1DevUrl`),htmlFor:`conn-d1-dev`,children:(0,J.jsx)(f,{id:`conn-d1-dev`,autoComplete:`off`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`http://localhost:8787`,value:e.devUrl??``,onChange:e=>r(`devUrl`,e.target.value.trim())})}),(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.d1DevUrlHint`)}),(0,J.jsx)(Z,{label:n(`connection.form.d1AccountId`),htmlFor:`conn-d1-account`,children:(0,J.jsx)(f,{id:`conn-d1-account`,autoComplete:`off`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`023e105f4ecef8ad9ca31a8372d0c353`,value:e.accountId??``,onChange:e=>r(`accountId`,e.target.value.trim())})}),(0,J.jsx)(Z,{label:n(`connection.form.d1DatabaseId`),htmlFor:`conn-d1-database`,children:o.length>0?(0,J.jsxs)(M,{value:e.databaseId??``,onValueChange:e=>r(`databaseId`,e),children:[(0,J.jsx)(k,{id:`conn-d1-database`,children:(0,J.jsx)(O,{placeholder:n(`connection.form.d1PickDatabase`)})}),(0,J.jsx)(A,{children:o.map(e=>(0,J.jsxs)(j,{value:e.id,children:[e.name,` · `,e.id]},e.id))})]}):(0,J.jsx)(f,{id:`conn-d1-database`,autoComplete:`off`,className:`font-mono text-xs`,spellCheck:!1,placeholder:`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`,value:e.databaseId??``,onChange:e=>r(`databaseId`,e.target.value.trim())})}),(0,J.jsx)(Z,{label:n(`connection.form.d1ApiToken`),htmlFor:`conn-pass`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(f,{id:`conn-pass`,type:`password`,autoComplete:`new-password`,value:e.pass,onChange:e=>r(`pass`,e.target.value.trim())}),(0,J.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs whitespace-nowrap cursor-pointer`,title:n(`connection.form.savePasswordHint`),children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.savePassword??!0,onChange:e=>r(`savePassword`,e.target.checked)}),n(`connection.form.savePassword`)]})]})}),(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.d1Hint`)}),(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.d1LimitsHint`)})]}):l?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:n(`connection.form.databaseFile`),htmlFor:`conn-file`,children:(0,J.jsx)(f,{id:`conn-file`,placeholder:n(`connection.form.filePathPlaceholder`),value:e.file??``,onChange:e=>r(`file`,e.target.value)})}),(0,J.jsx)(Z,{label:n(`connection.form.createIfMissing`),htmlFor:`conn-create`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`input`,{id:`conn-create`,type:`checkbox`,checked:e.createIfMissing??!1,onChange:e=>r(`createIfMissing`,e.target.checked),className:`size-4 accent-primary cursor-pointer`}),(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`connection.form.createIfMissingHint`)})]})})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:n(`connection.form.host`),htmlFor:`conn-host`,children:(0,J.jsx)(f,{id:`conn-host`,placeholder:e.dbms===`neon`?`ep-….aws.neon.tech`:e.dbms===`supabase`?`aws-0-….pooler.supabase.com`:`localhost`,value:e.host,onChange:e=>r(`host`,e.target.value)})}),(0,J.jsx)(Z,{label:n(`connection.form.port`),htmlFor:`conn-port`,children:(0,J.jsx)(f,{id:`conn-port`,type:`number`,value:e.port,onChange:t=>r(`port`,Number(t.target.value)||H.find(t=>t.id===e.dbms)?.defaultPort||3306)})}),T&&(0,J.jsx)(`p`,{className:`col-start-2 rounded-md border border-yellow-500/40 bg-yellow-500/10 px-2 py-1.5 text-xs leading-relaxed text-foreground`,children:n(`connection.form.supabasePoolerWarning`)}),(R(e.dbms)||e.dbms===`mssql`||e.dbms===`oracle`)&&(0,J.jsx)(Z,{label:e.dbms===`oracle`?n(`connection.form.serviceName`):n(`connection.form.database`),htmlFor:`conn-database`,children:(0,J.jsx)(f,{id:`conn-database`,placeholder:m(e.dbms),value:e.database??``,onChange:e=>r(`database`,e.target.value.trim())})}),(0,J.jsx)(Z,{label:n(`connection.form.user`),htmlFor:`conn-user`,children:(0,J.jsx)(f,{id:`conn-user`,autoComplete:`off`,placeholder:_(e.dbms),value:e.user,onChange:e=>r(`user`,e.target.value)})}),(0,J.jsx)(Z,{label:n(`connection.form.password`),htmlFor:`conn-pass`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(f,{id:`conn-pass`,type:`password`,autoComplete:`new-password`,value:e.pass,onChange:e=>r(`pass`,e.target.value)}),(0,J.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs whitespace-nowrap cursor-pointer`,title:n(`connection.form.savePasswordHint`),children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.savePassword??!0,onChange:e=>r(`savePassword`,e.target.checked)}),n(`connection.form.savePassword`)]})]})}),h&&(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.managedTlsHint`)}),!h&&e.dbms!==`oracle`&&(0,J.jsx)(Z,{label:n(`connection.form.tls`),children:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[(0,J.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer`,children:[(0,J.jsx)(`input`,{type:`checkbox`,checked:e.ssl??!1,onChange:e=>r(`ssl`,e.target.checked),className:`size-4 accent-primary`}),n(`connection.form.tlsEnable`)]}),(0,J.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer ${e.ssl?``:`opacity-50`}`,title:n(`connection.form.tlsVerifyHint`),children:[(0,J.jsx)(`input`,{type:`checkbox`,disabled:!e.ssl,checked:e.sslVerify??!1,onChange:e=>r(`sslVerify`,e.target.checked),className:`size-4 accent-primary`}),n(`connection.form.tlsVerify`)]})]})}),!h&&(0,J.jsx)(Z,{label:n(`connection.form.charset`),children:(0,J.jsxs)(M,{value:e.charset,onValueChange:e=>r(`charset`,e),children:[(0,J.jsx)(k,{className:`w-full`,children:(0,J.jsx)(O,{})}),(0,J.jsx)(A,{children:Y.map(e=>(0,J.jsx)(j,{value:e,children:e},e))})]})})]}),!l&&!h&&!g&&!y&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{className:`mt-1 flex items-center border-t pt-3 text-xs font-medium text-muted-foreground`,children:[n(`connection.form.ssh`),(0,J.jsx)(a,{className:`ml-2`})]}),(0,J.jsx)(Z,{label:n(`connection.form.sshTunnel`),htmlFor:`conn-ssh`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`input`,{id:`conn-ssh`,type:`checkbox`,checked:x.enabled,onChange:e=>{(!e.target.checked||F(`ssh_tunnel`))&&P({enabled:e.target.checked})},className:`size-4 accent-primary cursor-pointer`}),(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`connection.form.sshTunnelHint`)})]})}),x.enabled&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:n(`connection.form.sshHost`),htmlFor:`conn-ssh-host`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(f,{id:`conn-ssh-host`,placeholder:n(`connection.form.sshHostPlaceholder`),value:x.host,onChange:e=>P({host:e.target.value.trim()})}),(0,J.jsx)(f,{"aria-label":n(`connection.form.sshPort`),type:`number`,className:`w-24 shrink-0`,value:x.port,onChange:e=>P({port:Number(e.target.value)||22})})]})}),(0,J.jsx)(Z,{label:n(`connection.form.sshUser`),htmlFor:`conn-ssh-user`,children:(0,J.jsx)(f,{id:`conn-ssh-user`,placeholder:n(`connection.form.sshUserPlaceholder`),value:x.user,onChange:e=>P({user:e.target.value.trim()})})}),(0,J.jsx)(Z,{label:n(`connection.form.sshAuth`),children:(0,J.jsxs)(M,{value:x.auth,onValueChange:e=>P({auth:e}),children:[(0,J.jsx)(k,{className:`w-full`,children:(0,J.jsx)(O,{})}),(0,J.jsxs)(A,{children:[(0,J.jsx)(j,{value:`key`,children:n(`connection.form.sshAuthKey`)}),(0,J.jsx)(j,{value:`password`,children:n(`connection.form.sshAuthPassword`)}),(0,J.jsx)(j,{value:`agent`,children:n(`connection.form.sshAuthAgent`)})]})]})}),x.auth===`password`&&(0,J.jsx)(Z,{label:n(`connection.form.sshPassword`),htmlFor:`conn-ssh-pass`,children:(0,J.jsx)(f,{id:`conn-ssh-pass`,type:`password`,autoComplete:`new-password`,value:x.password??``,onChange:e=>P({password:e.target.value})})}),x.auth===`key`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Z,{label:n(`connection.form.sshKey`),htmlFor:`conn-ssh-key`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`input`,{id:`conn-ssh-key`,type:`file`,className:`hidden`,onChange:e=>{L(e.target.files?.[0]),e.target.value=``}}),(0,J.jsx)(D,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 shrink-0 px-2 text-xs`,onClick:()=>document.getElementById(`conn-ssh-key`)?.click(),children:x.privateKey?n(`connection.form.changeFile`):n(`connection.form.sshKeyPick`)}),(0,J.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,title:x.privateKeyName,children:x.privateKey?x.privateKeyName||n(`connection.form.sshKeyLoaded`):n(`connection.form.sshKeyHint`)})]})}),(0,J.jsx)(Z,{label:n(`connection.form.sshPassphrase`),htmlFor:`conn-ssh-passphrase`,children:(0,J.jsx)(f,{id:`conn-ssh-passphrase`,type:`password`,autoComplete:`new-password`,placeholder:n(`connection.form.sshPassphrasePlaceholder`),value:x.passphrase??``,onChange:e=>P({passphrase:e.target.value})})})]}),x.auth===`agent`&&(0,J.jsx)(`p`,{className:`col-start-2 text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.sshAuthAgentHint`)}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.sshTargetHint`)}),(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:n(`connection.form.sshSecretsHint`)})]})]}),(0,J.jsx)(Z,{label:n(`connection.form.autoConnection`),htmlFor:`conn-auto`,children:(0,J.jsx)(`div`,{className:`flex items-center`,children:(0,J.jsx)(`input`,{id:`conn-auto`,type:`checkbox`,checked:e.autoConnection,onChange:e=>r(`autoConnection`,e.target.checked),className:`size-4 accent-primary cursor-pointer`})})}),(0,J.jsx)(`div`,{className:`mt-1 border-t pt-3 text-xs font-medium text-muted-foreground`,children:n(`connection.form.safety`)}),(0,J.jsx)(Z,{label:n(`connection.form.environment`),children:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[d.map(t=>{let n=(e.environmentColor??`none`)===t.id;return(0,J.jsx)(`button`,{type:`button`,title:i(t.id),"aria-label":i(t.id),"aria-pressed":n,onClick:()=>r(`environmentColor`,t.id),className:`size-6 rounded-full border-2 transition-transform ${n?`scale-110 border-foreground`:`border-transparent hover:scale-105`}`,style:{background:t.id===`none`?`repeating-linear-gradient(45deg, transparent, transparent 3px, var(--muted-foreground) 3px, var(--muted-foreground) 4px)`:t.hex}},t.id)}),(0,J.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:n(`connection.form.environmentHint`)})]})}),(0,J.jsx)(Z,{label:n(`connection.form.readOnly`),htmlFor:`conn-readonly`,children:(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`input`,{id:`conn-readonly`,type:`checkbox`,checked:e.readOnly??!1,onChange:e=>r(`readOnly`,e.target.checked),className:`size-4 accent-primary cursor-pointer`}),(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`connection.form.readOnlyHint`)})]})}),b?.transactions!==!1&&(0,J.jsx)(Z,{label:n(`connection.form.transactions`),children:(0,J.jsxs)(M,{value:e.transactionMode??`auto`,onValueChange:e=>r(`transactionMode`,e),children:[(0,J.jsx)(k,{className:`w-full`,children:(0,J.jsx)(O,{})}),(0,J.jsxs)(A,{children:[(0,J.jsx)(j,{value:`auto`,children:n(`connection.form.txAuto`)}),(0,J.jsx)(j,{value:`manual`,children:n(`connection.form.txManual`)})]})]})})]})}function Q(){let{t:e}=E(),{activeDialog:i,closeDialog:a,showMessage:l}=C(),[d,f]=(0,U.useState)(!1),{savedConnections:m,addSavedConnection:_,updateSavedConnection:S,deleteSavedConnection:T,openConnection:O}=N(),k=w(`connect`)?.profileId,[A,j]=(0,U.useState)(()=>k??null),[M,F]=(0,U.useState)(()=>{let e=k?m.find(e=>e.id===k):void 0;return e?{...e}:null}),I=i===`connect`,[R,B]=(0,U.useState)(null),[H,W]=(0,U.useState)(null),G=r(e=>e.url),K=r(e=>e.token);(0,U.useEffect)(()=>{if(!I)return;let e=!1;return(async()=>{try{let t=await ee();if(e||t.state!==`online`||!t.gateway){e||B(null);return}let n=await te();e||(B({name:n.gateway,profiles:n.profiles}),W(null))}catch(t){e||W(t instanceof Error?t.message:String(t))}})(),()=>{e=!0}},[I,G,K]);function q(t){let n=m.find(e=>e.gatewayProfile===t.name);if(n){X(n);return}let r=g(t);_(r),X(r),C.getState().setFooterMessage(e(`connection.dialog.gatewayAdded`,{name:t.name}))}function Y(e){e||(a(),j(null),F(null))}function X(e){j(e.id),F({...e})}function Z(e){F(e),S(e.id,e)}function Q(){let e=s();_(e),j(e.id),F(e)}function pe(){A&&(T(A),j(null),F(null))}let[me,$]=(0,U.useState)(!1),he=P(e=>e.addQueryTab);function ge(t){let n=N.getState().activeConnections.some(e=>e.id===t.id);if(O(t),re.getState().removeTree(t.id),n){a(),j(null),F(null);return}he(t.id,{id:`tab-${Date.now()}`,title:e(`connection.dialog.firstQueryTab`),query:``,database:``,isExecuting:!1,results:[],error:null,executionTime:null}),a(),j(null),F(null)}async function _e(t){let n=await oe(t.id,{interactive:!0});if(!n)return;let r={...t,file:n.fileName,serverConnectionId:n.connectionId};S(t.id,{file:n.fileName}),ge(r),N.getState().setFileDetached(t.id,n.fileDetached),n.restoredUnsaved?C.getState().setFooterMessage(e(n.diskChanged?`connection.dialog.restoredUnsavedDiskChanged`:`connection.dialog.restoredUnsaved`,{file:n.fileName})):n.wal&&!n.walApplied?C.getState().setFooterMessage(e(`connection.dialog.walPending`,{file:n.fileName})):n.walApplied&&C.getState().setFooterMessage(e(`connection.dialog.walApplied`,{file:n.fileName}))}async function ve(t,n){try{return await n(t)}catch(r){let i=ne(r);if(!i||!(`ssh`in t)||!t.ssh||!await C.getState().requestDestructiveConfirm({title:e(`connection.dialog.hostKeyTitle`),description:e(`connection.dialog.hostKeyDescription`,i),confirmLabel:e(`connection.dialog.hostKeyAccept`)}))throw r;return n({...t,ssh:{...t.ssh,acceptHostKey:i.fingerprint}})}}async function ye(){if(M){$(!0);try{if(z(M)===`browser`){await _e(M);return}let t=await ve(L(M),e=>ae(e,M.authToken||void 0));t.success?ge({...M,serverConnectionId:t.connectionId}):l({tone:`error`,title:e(`connection.dialog.connectFailedTitle`),description:t.message??e(`connection.dialog.unknownError`)})}catch(t){l({tone:`error`,title:e(`connection.dialog.connectFailedTitle`),description:t instanceof Error?t.message:String(t)})}finally{$(!1)}}}async function be(){if(M){if(z(M)===`browser`){l({tone:`info`,title:e(`connection.dialog.testConnection`),description:e(`connection.dialog.browserTestHint`)});return}f(!0);try{let t=await ve(L(M),e=>ie(e,M.authToken||void 0));t.success?l({tone:`success`,title:e(`connection.dialog.testSuccess`),description:e(`connection.dialog.testSuccessDescription`)}):l({tone:`error`,title:e(`connection.dialog.testFailedTitle`),description:t.message??e(`connection.dialog.unknownError`)})}catch(t){l({tone:`error`,title:e(`connection.dialog.testFailedTitle`),description:t instanceof Error?t.message:String(t)})}finally{f(!1)}}}return(0,J.jsx)(de,{open:I,onOpenChange:Y,children:(0,J.jsxs)(le,{className:`sm:max-w-[1100px] h-[85vh] max-h-[85vh] flex flex-col`,children:[(0,J.jsx)(se,{children:(0,J.jsx)(ue,{children:e(`connection.dialog.title`)})}),(0,J.jsxs)(`p`,{className:`flex items-start gap-2 rounded-md border border-catppuccin-green/40 bg-catppuccin-green/10 px-3 py-2 text-xs leading-relaxed text-foreground`,children:[(0,J.jsx)(h,{className:`mt-0.5 size-4 shrink-0 text-catppuccin-green`,"aria-hidden":!0}),(0,J.jsx)(`span`,{children:e(`connection.dialog.privacy`)})]}),(0,J.jsxs)(`div`,{className:`flex flex-1 gap-4 overflow-hidden min-h-0`,children:[(0,J.jsxs)(`div`,{className:`w-[460px] shrink-0 border rounded-md overflow-hidden flex flex-col`,children:[(R||H)&&(0,J.jsxs)(`div`,{className:`border-b p-2 text-xs space-y-1 max-h-40 overflow-auto`,children:[(0,J.jsxs)(`p`,{className:`font-medium`,children:[e(`connection.dialog.gatewayTitle`),R?` — ${R.name}`:``]}),H&&(0,J.jsx)(`p`,{className:`text-destructive`,children:e(`connection.dialog.gatewayLoadFailed`,{error:H})}),R?.profiles.map(t=>(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 truncate`,children:[(0,J.jsx)(v,{dbms:p[t.driver],className:`size-3.5`}),(0,J.jsx)(`span`,{className:`truncate`,children:t.name}),(0,J.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,t.readOnly?e(`connection.dialog.gatewayReadOnly`):e(`connection.dialog.gatewayWritable`),`)`]})]}),(0,J.jsx)(D,{size:`sm`,variant:`outline`,className:`h-6 px-2 text-xs`,onClick:()=>q(t),children:e(`connection.dialog.gatewayAdd`)})]},t.name))]}),(0,J.jsx)(t,{className:`h-full`,children:(0,J.jsxs)(y,{className:`table-fixed`,children:[(0,J.jsx)(o,{children:(0,J.jsxs)(n,{children:[(0,J.jsx)(b,{className:`w-[32%]`,children:e(`connection.dialog.colHostName`)}),(0,J.jsx)(b,{className:`w-[40%]`,children:e(`connection.dialog.colTarget`)}),(0,J.jsx)(b,{className:`w-[28%]`,children:e(`connection.dialog.colDbms`)})]})}),(0,J.jsx)(x,{children:m.length===0?(0,J.jsx)(n,{children:(0,J.jsx)(c,{colSpan:3,className:`text-center text-muted-foreground`,children:e(`connection.dialog.noSaved`)})}):m.map(t=>(0,J.jsxs)(n,{"data-state":A===t.id?`selected`:void 0,className:`cursor-pointer`,onClick:()=>X(t),onDoubleClick:()=>{X(t),ye()},children:[(0,J.jsx)(c,{className:`truncate font-medium`,title:t.hostName,children:t.hostName||e(`connection.dialog.unnamed`)}),(0,J.jsx)(c,{className:`truncate`,title:t.dbms===`sqlite`?t.file:t.dbms===`d1`?t.databaseId:t.dbms===`do`?t.devUrl:`${t.user}@${t.host}:${t.port}`,children:t.dbms===`sqlite`?t.file||(z(t)===`browser`?e(`connection.dialog.pickOnConnect`):e(`connection.dialog.noFile`)):t.dbms===`d1`?t.databaseId||`—`:t.dbms===`do`?t.devUrl||`—`:`${t.user}@${t.host}:${t.port}`}),(0,J.jsx)(c,{className:`truncate`,title:V(t.dbms).label,children:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,J.jsx)(v,{dbms:t.dbms,className:`size-3.5`}),(0,J.jsx)(`span`,{className:`truncate`,children:V(t.dbms).label})]})})]},t.id))})]})})]}),(0,J.jsx)(`div`,{className:`flex-1 border rounded-md overflow-auto`,children:M?(0,J.jsxs)(J.Fragment,{children:[z(M)!==`browser`&&(0,J.jsx)(`div`,{className:`p-4 pb-0`,children:(0,J.jsx)(u,{})}),M.gatewayProfile?(0,J.jsxs)(`div`,{className:`p-4 space-y-2 text-sm`,children:[(0,J.jsxs)(`p`,{className:`font-medium flex items-center gap-2`,children:[(0,J.jsx)(v,{dbms:M.dbms,className:`size-4`}),M.hostName]}),(0,J.jsx)(`p`,{className:`text-muted-foreground`,children:e(`connection.dialog.gatewayProfileHint`,{name:M.gatewayProfile})}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[M.readOnly?e(`connection.dialog.gatewayReadOnly`):e(`connection.dialog.gatewayWritable`),M.database?` · ${M.database}`:``]})]}):(0,J.jsx)(fe,{value:M,onChange:Z})]}):(0,J.jsx)(`div`,{className:`flex items-center justify-center h-full text-muted-foreground text-sm`,children:e(`connection.dialog.selectPrompt`)})})]}),(0,J.jsxs)(ce,{className:`sm:justify-between`,children:[(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(D,{variant:`outline`,onClick:Q,children:e(`connection.dialog.addNew`)}),(0,J.jsx)(D,{variant:`destructive`,onClick:pe,disabled:!A,children:e(`connection.dialog.delete`)})]}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(D,{variant:`outline`,onClick:be,disabled:!M||d,children:e(`connection.dialog.testConnection`)}),(0,J.jsx)(D,{onClick:ye,disabled:!M||me,children:e(`connection.dialog.connect`)}),(0,J.jsx)(D,{variant:`outline`,onClick:()=>Y(!1),children:e(`connection.dialog.close`)})]})]})]})})}export{Q as ConnectDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n}from"./main-BPskUSLM.js";import{h as r,n as i,t as a}from"./ui-store-5IssrgmG.js";import{l as o,m as s,t as c}from"./button-B2EsmMJs.js";import{t as l}from"./connection-store-Ds9Gjt3K.js";import{a as u}from"./database-eJWHFM-2.js";import{n as d}from"./engine-DtZy_Zk0.js";import{c as f,p}from"./query-execution-C5QxvBZj.js";import{n as m,t as h}from"./table-copy-BJBmJ9OO.js";import{a as g,i as _,n as v,o as y,t as b}from"./dialog-FBpgH0QJ.js";var x=e(r(),1),S=o();function C(){let{t:e}=s(),{activeDialog:r,closeDialog:o}=i(),C=a(`copy-database`),w=r===`copy-database`,T=C?.database??``,[E,D]=(0,x.useState)(``),[O,k]=(0,x.useState)(`structure_data`),[A,j]=(0,x.useState)(null),[M,N]=(0,x.useState)(null);function P(e){e||(o(),N(null),j(null),D(``),k(`structure_data`))}async function F(){let t=l.getState().activeConnectionId,n=E.trim();if(!t||!n||!T)return;N(null);let r=d(t),i=l.getState().activeConnections.find(e=>e.id===t);if(i?.serverConnectionId)try{j(e(`database.copy.creating`,{database:n})),await f(t,r.getQuery(`CREATE_DATABASE`,n,`utf8mb4`,`utf8mb4_general_ci`));let a=u(i.serverConnectionId),o=await r.introspect.listTables(a,T);for(let[r,i]of o.entries()){j(e(`database.copy.copying`,{table:i.name,index:r+1,total:o.length}));let a={connectionId:t,database:T,table:i.name},s={connectionId:t,database:n,table:i.name},c=await h(a,s);await m({source:a,target:s,mode:O,onConflict:`abort`,createSql:d(t).ddl.createTable(c)})}await p(t),P(!1)}catch(e){N(e instanceof Error?e.message:String(e))}finally{j(null)}}return(0,S.jsx)(b,{open:w,onOpenChange:P,children:(0,S.jsxs)(v,{className:`sm:max-w-[450px]`,children:[(0,S.jsx)(g,{children:(0,S.jsx)(y,{children:e(`database.copy.title`)})}),(0,S.jsxs)(`div`,{className:`space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(t,{children:e(`database.copy.source`)}),(0,S.jsx)(n,{value:T,disabled:!0})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(t,{htmlFor:`target-db-name`,children:e(`database.copy.target`)}),(0,S.jsx)(n,{id:`target-db-name`,value:E,onChange:e=>D(e.target.value),placeholder:e(`database.copy.targetPlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,S.jsx)(t,{children:e(`database.copy.options`)}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,S.jsx)(`input`,{type:`radio`,name:`copy-option`,value:`structure_data`,checked:O===`structure_data`,onChange:()=>k(`structure_data`)}),e(`database.copy.structureAndData`)]}),(0,S.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,S.jsx)(`input`,{type:`radio`,name:`copy-option`,value:`structure_only`,checked:O===`structure_only`,onChange:()=>k(`structure_only`)}),e(`database.copy.structureOnly`)]})]})]})]}),A&&(0,S.jsx)(`p`,{className:`px-1 text-xs text-muted-foreground`,children:A}),M&&(0,S.jsx)(`p`,{className:`px-1 text-xs text-destructive leading-relaxed`,children:M}),(0,S.jsxs)(_,{children:[(0,S.jsx)(c,{variant:`outline`,onClick:()=>P(!1),children:e(`database.copy.cancel`)}),(0,S.jsx)(c,{onClick:()=>void F(),disabled:!E.trim()||A!==null,children:e(`database.copy.copy`)})]})]})})}export{C as CopyDatabaseDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{N as t,c as n,l as r}from"./main-BPskUSLM.js";import{h as i,n as a,t as ee}from"./ui-store-5IssrgmG.js";import{l as o,m as te,t as s}from"./button-B2EsmMJs.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-C3A-RS4G.js";import{t as ne}from"./connection-store-Ds9Gjt3K.js";import{a as p}from"./database-eJWHFM-2.js";import{n as m}from"./engine-DtZy_Zk0.js";import{t as re}from"./query-execution-C5QxvBZj.js";import{n as h,t as ie}from"./table-copy-BJBmJ9OO.js";import{a as ae,i as oe,n as g,o as se,t as ce}from"./dialog-FBpgH0QJ.js";var _=e(i(),1),v=o(),y=e=>e instanceof Error?e.message:String(e),b=e=>e.hostName||e.host||e.file||e.id,le=`w-full rounded border bg-background px-2 py-1 text-xs font-mono outline-none focus:ring-1 focus:ring-primary disabled:opacity-50 min-h-[160px] resize-y`;function x(){let{t:e}=te(),i=a(e=>e.activeDialog),o=a(e=>e.closeDialog),x=a(e=>e.showMessage),S=ee(`copy-table`),C=ne(e=>e.activeConnections),w=i===`copy-table`,T=S?.connectionId??``,E=String(S?.metadata?.database??``),D=S?.nodeText??``,O=C.find(e=>e.id===T),ue=C.filter(e=>e.serverConnectionId),[k,de]=(0,_.useState)(T),[A,j]=(0,_.useState)([]),[M,N]=(0,_.useState)(``),[P,F]=(0,_.useState)(D),[I,L]=(0,_.useState)(`structure_data`),[R,z]=(0,_.useState)(`abort`),[B,V]=(0,_.useState)(``),[H,U]=(0,_.useState)(null),[W,G]=(0,_.useState)(null),[K,q]=(0,_.useState)(null),[J,Y]=(0,_.useState)(!1),X=(0,_.useRef)(null),Z=C.find(e=>e.id===k),Q=Z?m(k):null,fe=!!O&&!!Z&&m(T).id===Q?.id;(0,_.useEffect)(()=>{if(!w||!Z?.serverConnectionId)return;let e=!1,t=m(k),n=p(Z.serverConnectionId);return(async()=>{j([]);try{let r=await t.introspect.listDatabases(n);if(e)return;j(r);let i=k===T,a=i||r.includes(E)?E:r[0]??``;N(a),F(e=>i&&a===E&&e===D?`${D}_copy`:e)}catch(t){e||q(y(t))}})(),()=>{e=!0}},[w,k]),(0,_.useEffect)(()=>{if(!w||!Z||!M||!P.trim()||!O)return;let e=!1;return(async()=>{U(null);try{let t=await ie({connectionId:T,database:E,table:D},{connectionId:k,database:M,table:P.trim()});e||V(m(k).ddl.createTable(t))}catch(t){e||U(y(t))}})(),()=>{e=!0}},[w,k,M,P]);function $(e){if(!e){if(J){X.current?.abort();return}o()}}async function pe(){if(!M||!P.trim()||!B.trim())return;Y(!0),q(null),G({phase:`create`,copied:0,total:null});let t=new AbortController;X.current=t;try{let n=await h({source:{connectionId:T,database:E,table:D},target:{connectionId:k,database:M,table:P.trim()},mode:I,onConflict:R,createSql:B},G,t.signal);o(),await x({title:e(`table.copy.doneTitle`),description:I===`structure_data`?e(`table.copy.doneRows`,{count:n.rows,table:P.trim()}):e(`table.copy.doneStructure`,{table:P.trim()}),tone:`success`})}catch(e){e instanceof re||q(y(e)),G(null)}finally{Y(!1),X.current=null}}let me=W?.phase===`copy`&&W.total?Math.min(100,Math.round(W.copied/W.total*100)):null,he=W?W.phase===`create`?e(`table.copy.progressCreate`):W.phase===`count`?e(`table.copy.progressCount`):W.phase===`copy`?e(`table.copy.progressRows`,{copied:W.copied,total:W.total??`?`}):e(`table.copy.progressDone`):``;return(0,v.jsx)(ce,{open:w,onOpenChange:$,children:(0,v.jsxs)(g,{className:`sm:max-w-[640px]`,children:[(0,v.jsx)(ae,{children:(0,v.jsx)(se,{children:e(`table.copy.title`)})}),(0,v.jsxs)(`div`,{className:`space-y-4`,children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{children:e(`table.copy.source`)}),(0,v.jsx)(r,{value:O?`${b(O)} / ${E} / ${D}`:``,disabled:!0})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{htmlFor:`copy-target-conn`,children:e(`table.copy.targetConnection`)}),(0,v.jsxs)(f,{value:k,onValueChange:de,disabled:J,children:[(0,v.jsx)(l,{id:`copy-target-conn`,className:`w-full`,children:(0,v.jsx)(c,{})}),(0,v.jsx)(u,{children:ue.map(t=>(0,v.jsxs)(d,{value:t.id,children:[b(t),t.readOnly?` (${e(`table.copy.readOnly`)})`:``]},t.id))})]})]}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{htmlFor:`copy-target-db`,children:e(`table.copy.targetDatabase`)}),(0,v.jsxs)(f,{value:M,onValueChange:N,disabled:J||A.length===0,children:[(0,v.jsx)(l,{id:`copy-target-db`,className:`w-full`,children:(0,v.jsx)(c,{placeholder:e(`table.copy.loading`)})}),(0,v.jsx)(u,{children:A.map(e=>(0,v.jsx)(d,{value:e,children:e},e))})]})]})]}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{htmlFor:`copy-target-table`,children:e(`table.copy.targetTable`)}),(0,v.jsx)(r,{id:`copy-target-table`,value:P,onChange:e=>F(e.target.value),disabled:J,spellCheck:!1})]}),(0,v.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{children:e(`table.copy.what`)}),(0,v.jsxs)(`div`,{className:`space-y-1`,children:[(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,v.jsx)(`input`,{type:`radio`,name:`copy-mode`,checked:I===`structure_data`,onChange:()=>L(`structure_data`),disabled:J}),e(`table.copy.structureAndData`)]}),(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,v.jsx)(`input`,{type:`radio`,name:`copy-mode`,checked:I===`structure_only`,onChange:()=>L(`structure_only`),disabled:J}),e(`table.copy.structureOnly`)]})]})]}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{children:e(`table.copy.ifExists`)}),(0,v.jsxs)(`div`,{className:`space-y-1`,children:[(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,v.jsx)(`input`,{type:`radio`,name:`copy-conflict`,checked:R===`abort`,onChange:()=>z(`abort`),disabled:J}),e(`table.copy.abort`)]}),(0,v.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer text-destructive`,children:[(0,v.jsx)(`input`,{type:`radio`,name:`copy-conflict`,checked:R===`drop`,onChange:()=>z(`drop`),disabled:J}),e(`table.copy.dropAndRecreate`)]})]})]})]}),(0,v.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,v.jsx)(n,{htmlFor:`copy-ddl`,children:e(`table.copy.preview`)}),!fe&&Q&&(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`table.copy.crossEngineHint`,{engine:Q.label})}),(0,v.jsx)(`textarea`,{id:`copy-ddl`,className:le,value:B,onChange:e=>V(e.target.value),disabled:J,spellCheck:!1}),H&&(0,v.jsx)(`p`,{className:`text-xs text-destructive`,children:H})]}),W&&(0,v.jsxs)(`div`,{className:`space-y-1`,children:[(0,v.jsx)(t,{value:me??(W.phase===`done`?100:0)}),(0,v.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:he})]}),K&&(0,v.jsx)(`p`,{className:`text-sm text-destructive whitespace-pre-wrap`,children:K})]}),(0,v.jsxs)(oe,{children:[(0,v.jsx)(s,{variant:`outline`,onClick:()=>$(!1),children:e(J?`table.copy.stop`:`table.copy.cancel`)}),(0,v.jsx)(s,{onClick:()=>{pe()},disabled:J||!M||!P.trim()||!B.trim()||!!H,children:e(`table.copy.copy`)})]})]})})}export{x as CopyTableDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n}from"./main-BPskUSLM.js";import{h as r,n as i}from"./ui-store-5IssrgmG.js";import{l as a,m as o,t as s}from"./button-B2EsmMJs.js";import{a as c,i as l,n as u,r as d,t as f}from"./select-C3A-RS4G.js";import{t as p}from"./connection-store-Ds9Gjt3K.js";import{n as m}from"./engine-DtZy_Zk0.js";import{c as h,p as g}from"./query-execution-C5QxvBZj.js";import{a as _,i as v,n as y,o as b,t as x}from"./dialog-FBpgH0QJ.js";var S=e(r(),1),C=a(),w=[`utf8mb4`,`utf8`,`latin1`,`ascii`,`binary`,`cp1251`,`euckr`,`gb2312`,`gbk`,`sjis`,`ucs2`,`utf16`,`utf32`],T={utf8mb4:[`utf8mb4_general_ci`,`utf8mb4_unicode_ci`,`utf8mb4_bin`,`utf8mb4_0900_ai_ci`],utf8:[`utf8_general_ci`,`utf8_unicode_ci`,`utf8_bin`],latin1:[`latin1_swedish_ci`,`latin1_general_ci`,`latin1_bin`],ascii:[`ascii_general_ci`,`ascii_bin`],binary:[`binary`],cp1251:[`cp1251_general_ci`,`cp1251_bin`],euckr:[`euckr_korean_ci`,`euckr_bin`],gb2312:[`gb2312_chinese_ci`,`gb2312_bin`],gbk:[`gbk_chinese_ci`,`gbk_bin`],sjis:[`sjis_japanese_ci`,`sjis_bin`],ucs2:[`ucs2_general_ci`,`ucs2_unicode_ci`,`ucs2_bin`],utf16:[`utf16_general_ci`,`utf16_unicode_ci`,`utf16_bin`],utf32:[`utf32_general_ci`,`utf32_unicode_ci`,`utf32_bin`]};function E(){let{t:e}=o(),{activeDialog:r,closeDialog:a}=i(),E=r===`create-database`,[D,O]=(0,S.useState)(``),[k,A]=(0,S.useState)(`utf8mb4`),[j,M]=(0,S.useState)(`utf8mb4_general_ci`),[N,P]=(0,S.useState)(!1),[F,I]=(0,S.useState)(null);function L(e){e||(a(),I(null),O(``),A(`utf8mb4`),M(`utf8mb4_general_ci`))}function R(e){A(e);let t=T[e];M(t?.[0]??``)}async function z(){let e=p.getState().activeConnectionId,t=D.trim();if(!(!e||!t)){I(null),P(!0);try{let n=m(e).getQuery(`CREATE_DATABASE`,t,k,j);await h(e,n),await g(e),L(!1)}catch(e){I(e instanceof Error?e.message:String(e))}finally{P(!1)}}}let B=T[k]??[];return(0,C.jsx)(x,{open:E,onOpenChange:L,children:(0,C.jsxs)(y,{className:`sm:max-w-[450px]`,children:[(0,C.jsx)(_,{children:(0,C.jsx)(b,{children:e(`database.create.title`)})}),(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsx)(t,{htmlFor:`db-name`,children:e(`database.create.name`)}),(0,C.jsx)(n,{id:`db-name`,value:D,onChange:e=>O(e.target.value),placeholder:e(`database.create.namePlaceholder`)})]}),(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsx)(t,{htmlFor:`db-charset`,children:e(`database.create.charset`)}),(0,C.jsxs)(f,{value:k,onValueChange:R,children:[(0,C.jsx)(l,{id:`db-charset`,className:`w-full`,children:(0,C.jsx)(c,{})}),(0,C.jsx)(u,{children:w.map(e=>(0,C.jsx)(d,{value:e,children:e},e))})]})]}),(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsx)(t,{htmlFor:`db-collation`,children:e(`database.create.collation`)}),(0,C.jsxs)(f,{value:j,onValueChange:M,children:[(0,C.jsx)(l,{id:`db-collation`,className:`w-full`,children:(0,C.jsx)(c,{})}),(0,C.jsx)(u,{children:B.map(e=>(0,C.jsx)(d,{value:e,children:e},e))})]})]})]}),F&&(0,C.jsx)(`p`,{className:`px-1 text-xs text-destructive leading-relaxed`,children:F}),(0,C.jsxs)(v,{children:[(0,C.jsx)(s,{variant:`outline`,onClick:()=>L(!1),children:e(`database.create.cancel`)}),(0,C.jsx)(s,{onClick:()=>void z(),disabled:!D.trim()||N,children:e(`database.create.create`)})]})]})})}export{E as CreateDatabaseDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{c as t,l as n}from"./main-BPskUSLM.js";import{h as r,n as i,t as a}from"./ui-store-5IssrgmG.js";import{l as o,m as s,t as c}from"./button-B2EsmMJs.js";import{t as l}from"./connection-store-Ds9Gjt3K.js";import{n as u}from"./engine-DtZy_Zk0.js";import{c as d,p as f}from"./query-execution-C5QxvBZj.js";import{a as p,i as m,n as h,o as g,t as _}from"./dialog-FBpgH0QJ.js";var v=e(r(),1),y=o();function b(){let{t:e}=s(),{activeDialog:r,closeDialog:o}=i(),b=a(`create-schema`),x=r===`create-schema`,[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(null);function O(e){e||(o(),C(``),D(null))}async function k(){let e=b?.connectionId??l.getState().activeConnectionId,t=S.trim();if(!(!e||!t)){D(null),T(!0);try{await d(e,u(e).getQuery(`CREATE_SCHEMA`,t)),await f(e),O(!1)}catch(e){D(e instanceof Error?e.message:String(e))}finally{T(!1)}}}return(0,y.jsx)(_,{open:x,onOpenChange:O,children:(0,y.jsxs)(h,{className:`sm:max-w-[420px]`,children:[(0,y.jsx)(p,{children:(0,y.jsx)(g,{children:e(`database.schema.createTitle`)})}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(t,{htmlFor:`schema-name`,children:e(`database.schema.name`)}),(0,y.jsx)(n,{id:`schema-name`,value:S,autoFocus:!0,placeholder:e(`database.schema.namePlaceholder`),onChange:e=>C(e.target.value),onKeyDown:e=>{e.key===`Enter`&&k()}})]}),E&&(0,y.jsx)(`p`,{className:`text-xs text-destructive leading-relaxed`,children:E}),(0,y.jsxs)(m,{children:[(0,y.jsx)(c,{variant:`outline`,onClick:()=>O(!1),children:e(`database.schema.cancel`)}),(0,y.jsx)(c,{onClick:()=>void k(),disabled:!S.trim()||w,children:e(`database.schema.create`)})]})]})})}export{b as CreateSchemaDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{V as t,_ as n,c as r,g as i,h as a,k as o}from"./main-BPskUSLM.js";import{c as s,h as c,n as l,t as u}from"./ui-store-5IssrgmG.js";import{l as d,m as f,t as p}from"./button-B2EsmMJs.js";import{a as m,i as h,n as g,r as _,t as v}from"./select-C3A-RS4G.js";import{t as y}from"./connection-store-Ds9Gjt3K.js";import{t as ee}from"./pro-usage-WSD_KOk4.js";import{a as b}from"./database-eJWHFM-2.js";import{n as x}from"./engine-DtZy_Zk0.js";import{a as S,i as te,n as C,o as ne,t as w}from"./dialog-FBpgH0QJ.js";var T=e(c(),1),E=d(),D=e=>e instanceof Error?e.message:String(e),O=e=>e.hostName||e.host||e.file||e.id,k=5e4;function A({id:e,label:t,side:n,onChange:i,connections:a,disabled:o}){let{t:s}=f(),[c,l]=(0,T.useState)([]),[u,d]=(0,T.useState)([]),p=a.find(e=>e.id===n.connectionId);return(0,T.useEffect)(()=>{if(!p?.serverConnectionId)return;let e=!1;return(async()=>{try{let t=await x(p.id).introspect.listDatabases(b(p.serverConnectionId));if(e)return;l(t),t.includes(n.database)||i({connectionId:p.id,database:t[0]??``,table:``})}catch{e||l([])}})(),()=>{e=!0}},[p?.id,p?.serverConnectionId]),(0,T.useEffect)(()=>{if(!p?.serverConnectionId||!n.database)return;let e=!1;return(async()=>{try{let t=await x(p.id).introspect.listTables(b(p.serverConnectionId),n.database);if(e)return;let r=t.map(e=>e.name);d(r),n.table&&!r.includes(n.table)&&i({...n,table:``})}catch{e||d([])}})(),()=>{e=!0}},[p?.id,p?.serverConnectionId,n.database]),(0,E.jsxs)(`div`,{className:`space-y-2 rounded-md border p-3`,children:[(0,E.jsx)(r,{className:`font-medium`,children:t}),(0,E.jsxs)(v,{value:n.connectionId,onValueChange:e=>i({connectionId:e,database:``,table:``}),disabled:o,children:[(0,E.jsx)(h,{id:`${e}-conn`,className:`w-full`,children:(0,E.jsx)(m,{placeholder:s(`database.diff.pickConnection`)})}),(0,E.jsx)(g,{children:a.map(e=>(0,E.jsx)(_,{value:e.id,children:O(e)},e.id))})]}),(0,E.jsxs)(v,{value:n.database,onValueChange:e=>i({...n,database:e,table:``}),disabled:o||c.length===0,children:[(0,E.jsx)(h,{id:`${e}-db`,className:`w-full`,children:(0,E.jsx)(m,{placeholder:s(`database.diff.pickDatabase`)})}),(0,E.jsx)(g,{children:c.map(e=>(0,E.jsx)(_,{value:e,children:e},e))})]}),(0,E.jsxs)(v,{value:n.table,onValueChange:e=>i({...n,table:e}),disabled:o||u.length===0,children:[(0,E.jsx)(h,{id:`${e}-table`,className:`w-full`,children:(0,E.jsx)(m,{placeholder:s(`database.dataDiff.pickTable`)})}),(0,E.jsx)(g,{children:u.map(e=>(0,E.jsx)(_,{value:e,children:e},e))})]})]})}async function j(e,n){let r=await t({connectionId:e.connectionId,database:e.database,table:e.table,limit:k,onProgress:n}),i=[];for await(let e of r.pages)i.push(...e);return{rows:i,columns:r.fields.map(e=>e.name),capped:i.length>=k}}function M({diff:e,row:t,other:n,changed:r}){let{t:a}=f(),o=[...e.keyColumns,...e.compareColumns];return(0,E.jsxs)(`table`,{className:`w-full text-xs font-mono`,children:[(0,E.jsx)(`thead`,{className:`text-muted-foreground`,children:(0,E.jsxs)(`tr`,{children:[(0,E.jsx)(`th`,{className:`text-left font-normal pr-2`,children:a(`database.diff.column`)}),(0,E.jsx)(`th`,{className:`text-left font-normal pr-2`,children:a(`database.diff.source`)}),(0,E.jsx)(`th`,{className:`text-left font-normal`,children:a(`database.diff.target`)})]})}),(0,E.jsx)(`tbody`,{children:o.map(e=>(0,E.jsxs)(`tr`,{className:r?.includes(e)?`text-amber-600 dark:text-amber-400`:``,children:[(0,E.jsx)(`td`,{className:`pr-2 align-top whitespace-nowrap`,children:e}),(0,E.jsx)(`td`,{className:`pr-2 align-top break-all`,children:i(t[e])}),(0,E.jsx)(`td`,{className:`align-top break-all`,children:n?i(n[e]):`—`})]},e))})]})}function N(){let{t:e}=f(),t=l(e=>e.activeDialog),r=l(e=>e.closeDialog),c=u(`data-diff`),d=y(e=>e.activeConnections),m=(0,T.useMemo)(()=>d.filter(e=>e.serverConnectionId),[d]),h=y(e=>e.activeConnectionId),g=t===`data-diff`,[_,v]=(0,T.useState)(()=>c&&m.some(e=>e.id===c.connectionId)?{connectionId:c.connectionId,database:c.database,table:c.table}:{connectionId:h&&m.some(e=>e.id===h)?h:m[0]?.id??``,database:``,table:``}),[O,N]=(0,T.useState)(()=>({connectionId:m.find(e=>e.id!==_.connectionId)?.id??_.connectionId,database:``,table:``})),[P,re]=(0,T.useState)([]),[F,I]=(0,T.useState)(null),[ie,ae]=(0,T.useState)(!1),[L,R]=(0,T.useState)(`changed`),[z,B]=(0,T.useState)(0),[V,H]=(0,T.useState)(!1),[U,W]=(0,T.useState)(!1),[G,K]=(0,T.useState)({source:null,target:null}),[q,J]=(0,T.useState)(null),oe=e=>N(e.database&&!e.table&&_.table?{...e,table:_.table}:e),Y=_.connectionId===O.connectionId&&_.database===O.database&&_.table===O.table,se=!!_.table&&!!O.table&&!Y,X=O.connectionId?x(O.connectionId):null;async function ce(){W(!0),J(null),I(null);try{let t=y.getState().activeConnections.find(e=>e.id===_.connectionId);if(!t?.serverConnectionId)throw Error(e(`services.query.notConnected`));let r=await x(_.connectionId).introspect.getPrimaryKeys(b(t.serverConnectionId),_.database,_.table);if(r.length===0)throw Error(e(`database.dataDiff.noPrimaryKey`,{table:_.table}));K({source:{loaded:0,total:null},target:{loaded:0,total:null}});let[i,a]=await Promise.all([j(_,e=>K(t=>({...t,source:e}))),j(O,e=>K(t=>({...t,target:e})))]);if(r.some(e=>!a.columns.includes(e)))throw Error(e(`database.dataDiff.keyMissingInTarget`,{columns:r.join(`, `)}));let o=n(i.rows,a.rows,r,i.columns,a.columns);re(r),ae(i.capped||a.capped),I(o),R(o.changed.length>0?`changed`:o.added.length>0?`added`:`removed`),B(0),ee(`compare_data`),s(`data_diff`,{source_dbms:x(_.connectionId).id,target_dbms:X?.id??`unknown`,added:o.added.length,changed:o.changed.length,removed:o.removed.length})}catch(e){J(D(e))}finally{W(!1),K({source:null,target:null})}}let Z=e=>e?e.total===null?e.loaded.toLocaleString():`${e.loaded.toLocaleString()} / ${e.total.toLocaleString()}`:``,Q=(0,T.useMemo)(()=>F&&X?a(F,X,{database:O.database,table:O.table},{includeDeletes:V}):``,[F,X,O.database,O.table,V]);function le(){Q&&(o(O.connectionId,Q,O.database,e(`database.dataDiff.tabTitle`,{table:O.table})),r())}let $=F?L===`added`?F.added:L===`removed`?F.removed:F.changed.map(e=>e.source):[],ue=!!F&&F.added.length+F.changed.length+F.removed.length>0,de=e=>P.map(t=>i(e[t])).join(`, `);return(0,E.jsx)(w,{open:g,onOpenChange:e=>{e||r()},children:(0,E.jsxs)(C,{className:`sm:max-w-[900px]`,children:[(0,E.jsx)(S,{children:(0,E.jsx)(ne,{children:e(`database.dataDiff.title`)})}),(0,E.jsxs)(`div`,{className:`space-y-3`,children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,E.jsx)(A,{id:`ddiff-source`,label:e(`database.diff.source`),side:_,onChange:v,connections:m,disabled:U}),(0,E.jsx)(A,{id:`ddiff-target`,label:e(`database.diff.target`),side:O,onChange:oe,connections:m,disabled:U})]}),(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`database.dataDiff.hint`,{cap:k.toLocaleString()})}),Y&&_.table&&(0,E.jsx)(`p`,{className:`text-xs text-destructive`,children:e(`database.dataDiff.sameSide`)}),q&&(0,E.jsx)(`p`,{className:`text-sm text-destructive whitespace-pre-wrap`,children:q}),U&&(G.source||G.target)&&(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`database.dataDiff.loading`,{source:Z(G.source),target:Z(G.target)})}),F&&(0,E.jsxs)(`div`,{className:`space-y-2`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-xs`,children:[(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:e(`database.dataDiff.summary`,{key:P.join(`, `),added:F.added.length,changed:F.changed.length,removed:F.removed.length,identical:F.identical})}),ie&&(0,E.jsx)(`span`,{className:`text-amber-600 dark:text-amber-400`,children:e(`database.dataDiff.capped`,{cap:k.toLocaleString()})}),(F.sourceOnlyColumns.length>0||F.targetOnlyColumns.length>0)&&(0,E.jsx)(`span`,{className:`text-muted-foreground`,children:e(`database.dataDiff.ignoredColumns`,{columns:[...F.sourceOnlyColumns,...F.targetOnlyColumns].join(`, `)})})]}),(0,E.jsx)(`div`,{className:`flex gap-1 text-xs`,children:[`added`,`changed`,`removed`].map(t=>(0,E.jsx)(`button`,{type:`button`,onClick:()=>{R(t),B(0)},className:`rounded border px-2 py-0.5 ${L===t?`bg-accent`:``}`,children:e(`database.dataDiff.${t}`,{count:t===`added`?F.added.length:t===`removed`?F.removed.length:F.changed.length})},t))}),(0,E.jsxs)(`div`,{className:`grid grid-cols-[240px_1fr] gap-3 h-[280px]`,children:[(0,E.jsxs)(`ul`,{className:`overflow-auto rounded-md border text-sm font-mono`,children:[$.slice(0,2e3).map((e,t)=>(0,E.jsx)(`li`,{className:`px-2 py-1 cursor-pointer ${z===t?`bg-accent`:``}`,onClick:()=>B(t),children:de(e)},t)),$.length===0&&(0,E.jsx)(`li`,{className:`px-2 py-1 text-muted-foreground`,children:e(`database.dataDiff.none`)}),$.length>2e3&&(0,E.jsx)(`li`,{className:`px-2 py-1 text-muted-foreground`,children:e(`database.dataDiff.more`,{count:$.length-2e3})})]}),(0,E.jsx)(`div`,{className:`overflow-auto rounded-md border p-2`,children:$[z]?L===`changed`?(0,E.jsx)(M,{diff:F,row:F.changed[z].source,other:F.changed[z].target,changed:F.changed[z].columns}):L===`removed`?(0,E.jsx)(M,{diff:F,row:{},other:$[z]}):(0,E.jsx)(M,{diff:F,row:$[z]}):(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`database.diff.selectTable`)})})]}),(0,E.jsxs)(`label`,{className:`flex items-center gap-1.5 text-xs cursor-pointer`,children:[(0,E.jsx)(`input`,{type:`checkbox`,checked:V,onChange:e=>H(e.target.checked)}),(0,E.jsx)(`span`,{className:V?`text-destructive`:``,children:e(`database.dataDiff.includeDeletes`)})]})]})]}),(0,E.jsxs)(te,{children:[(0,E.jsx)(p,{variant:`outline`,onClick:r,children:e(`database.diff.close`)}),(0,E.jsx)(p,{variant:`secondary`,onClick:()=>{ce()},disabled:!se||U,children:e(U?`database.diff.comparing`:`database.diff.compare`)}),(0,E.jsx)(p,{onClick:le,disabled:!ue,children:e(`database.diff.openScript`)})]})]})})}export{N as DataDiffDialog};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{N as t,V as n,c as r,l as i}from"./main-BPskUSLM.js";import{c as a,h as o,n as s,t as c}from"./ui-store-5IssrgmG.js";import{l,m as u,t as d}from"./button-B2EsmMJs.js";import{a as f,i as p,n as m,r as h,t as g}from"./select-C3A-RS4G.js";import{t as _}from"./connection-store-Ds9Gjt3K.js";import{n as v}from"./query-store-BR6Saeed.js";import{a as y}from"./database-eJWHFM-2.js";import{o as b}from"./dbms-BwnatOMe.js";import{n as x}from"./engine-DtZy_Zk0.js";import{n as S}from"./query-execution-C5QxvBZj.js";import{a as ee,i as te,n as ne,o as re,t as ie}from"./dialog-FBpgH0QJ.js";import{t as C}from"./file-name-CnYBZPf9.js";var w=e(o(),1);function T(e,t){let n=e==null?``:typeof e==`object`?JSON.stringify(e):String(e);return!(typeof e==`number`||typeof e==`bigint`||/^[-+]?\d+(\.\d+)?([eE][-+]?\d+)?$/.test(n))&&/^[=+\-@\t\r]/.test(n)&&(n=`'${n}`),n.includes(t)||n.includes(`"`)||n.includes(`
|
|
2
2
|
`)||n.includes(`\r`)?`"${n.replace(/"/g,`""`)}"`:n}var E=(e,t)=>e.map(e=>T(e,t)).join(t)+`
|
|
3
|
-
`,D=e=>e===` `,O=e=>D(e)?`TSV`:`CSV`,k=e=>D(e)?`.tsv`:`.csv`,A=e=>D(e)?`text/tab-separated-values`:`text/csv`;async function j(e,t){let n=C(e),r=A(t);if(typeof window.showSaveFilePicker==`function`)try{let e=await(await window.showSaveFilePicker({suggestedName:n,types:[{description:O(t),accept:{[r]:[k(t)]}}]})).createWritable();return await e.write(``),{write:t=>e.write(t),finish:()=>e.close(),abort:()=>e.abort()}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)throw new M}let i=[``];return{write:async e=>{i.push(e)},finish:async()=>{let e=new Blob(i,{type:`${r};charset=utf-8;`}),t=URL.createObjectURL(e),a=document.createElement(`a`);a.href=t,a.download=n,a.click(),URL.revokeObjectURL(t)},abort:async()=>{i.length=0}}}var M=class extends Error{constructor(){super(`CSV export cancelled`)}};async function N(
|
|
3
|
+
`,D=e=>e===` `,O=e=>D(e)?`TSV`:`CSV`,k=e=>D(e)?`.tsv`:`.csv`,A=e=>D(e)?`text/tab-separated-values`:`text/csv`;async function j(e,t){let n=C(e),r=A(t);if(typeof window.showSaveFilePicker==`function`)try{let e=await(await window.showSaveFilePicker({suggestedName:n,types:[{description:O(t),accept:{[r]:[k(t)]}}]})).createWritable();return await e.write(``),{write:t=>e.write(t),finish:()=>e.close(),abort:()=>e.abort()}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)throw new M}let i=[``];return{write:async e=>{i.push(e)},finish:async()=>{let e=new Blob(i,{type:`${r};charset=utf-8;`}),t=URL.createObjectURL(e),a=document.createElement(`a`);a.href=t,a.download=n,a.click(),URL.revokeObjectURL(t)},abort:async()=>{i.length=0}}}var M=class extends Error{constructor(){super(`CSV export cancelled`)}};async function N(e){let t=await j(`${e.table}${k(e.delimiter)}`,e.delimiter),r=0;try{let i=await n({connectionId:e.connectionId,database:e.database,table:e.table,signal:e.signal,onProgress:e.onProgress}),o=i.fields.map(e=>e.name);e.includeHeaders&&await t.write(E(o,e.delimiter));for await(let n of i.pages)await t.write(n.map(t=>E(o.map(e=>t[e]),e.delimiter)).join(``)),r+=n.length;return await t.finish(),a(`export_csv`,{source:`table`,rows:r,format:O(e.delimiter)}),r}catch(e){throw await t.abort().catch(()=>void 0),e}}function P(e,t,n,r,i){let o=e.map(e=>e.name),s=[``];r&&s.push(E(o,n));for(let e of t)s.push(E(o.map(t=>e[t]),n));let c=new Blob(s,{type:`${A(n)};charset=utf-8;`}),l=URL.createObjectURL(c),u=document.createElement(`a`);u.href=l,u.download=C(i??`query_result${k(n)}`),u.click(),URL.revokeObjectURL(l),a(`export_csv`,{source:`result`,rows:t.length,format:O(n)})}var F=l(),I=[{value:`,`,label:`database.csv.delimiterComma`},{value:` `,label:`database.csv.delimiterTab`},{value:`;`,label:`database.csv.delimiterSemicolon`},{value:`|`,label:`database.csv.delimiterPipe`}];function L(){let{t:e}=u(),{activeDialog:n,closeDialog:a}=s(),o=c(`export-csv`),l=_(e=>e.activeConnectionId),C=v(),T=n===`export-csv`,[E,O]=(0,w.useState)(`query_result`),[k,A]=(0,w.useState)(``),[j,L]=(0,w.useState)([]),[R,z]=(0,w.useState)(``),[B,V]=(0,w.useState)(`,`),[H,U]=(0,w.useState)(!0),[W,G]=(0,w.useState)(!1),[K,q]=(0,w.useState)(null),[J,Y]=(0,w.useState)(null),X=(0,w.useRef)(null),Z=D(B)?`TSV`:`CSV`,Q=()=>{if(o?.nodeText&&(o.nodeType===b.TABLE||o.nodeType===b.VIEW)){let e=o.metadata?.database;return{table:o.nodeText,database:typeof e==`string`?e:``}}if(!l)return null;let e=(C.tabs[l]??[]).find(e=>e.id===C.activeTabId[l]);return e?.sourceTable?{table:e.sourceTable.table,database:e.sourceTable.database}:null};(0,w.useEffect)(()=>{if(!T)return;let e=Q();V(o?.delimiter??`,`),e&&(A(e.table),O(`table_data`))},[T]),(0,w.useEffect)(()=>{if(!T||!l)return;let e=_.getState().activeConnections.find(e=>e.id===l);if(!e?.serverConnectionId)return;let t=!1;return(async()=>{try{let n=await x(l).introspect.listDatabases(y(e.serverConnectionId));if(t)return;L(n);let r=C.tabs[l]?.find(e=>e.id===C.activeTabId[l])?.database||``,i=Q()?.database||``;z(e=>n.includes(i)?i:n.includes(e)?e:n.includes(r)?r:n.length===1?n[0]:``)}catch{t||L([])}})(),()=>{t=!0}},[T,l]);function $(e){if(!e){if(W){X.current?.abort();return}a(),O(`query_result`),A(``),V(`,`),U(!0)}}async function ae(){if(!l)return;if(Y(null),E===`query_result`){let e=C.activeTabId[l],t=(C.tabs[l]??[]).find(t=>t.id===e)?.results?.[0];if(!t||t.rows.length===0)return;P(t.fields,t.rows,B,H),a();return}if(!k.trim()||!R)return;let t=new AbortController;X.current=t,G(!0),q({loaded:0,total:null});try{let n=await N({connectionId:l,database:R,table:k.trim(),delimiter:B,includeHeaders:H,onProgress:q,signal:t.signal});s.getState().setFooterMessage(e(`database.csv.done`,{count:n,table:k.trim(),format:Z})),a()}catch(e){!(e instanceof M)&&!(e instanceof S&&t.signal.aborted)&&Y(e instanceof Error?e.message:String(e))}finally{G(!1),q(null),X.current=null}}let oe=K?.total?Math.min(100,Math.round(K.loaded/K.total*100)):null;return(0,F.jsx)(ie,{open:T,onOpenChange:$,children:(0,F.jsxs)(ne,{className:`sm:max-w-[450px]`,children:[(0,F.jsx)(ee,{children:(0,F.jsx)(re,{children:e(`database.csv.title`,{format:Z})})}),(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsx)(r,{children:e(`database.csv.target`)}),(0,F.jsxs)(`div`,{className:`space-y-2`,children:[(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,F.jsx)(`input`,{type:`radio`,name:`csv-target`,value:`query_result`,checked:E===`query_result`,onChange:()=>O(`query_result`)}),e(`database.csv.targetQueryResult`)]}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,F.jsx)(`input`,{type:`radio`,name:`csv-target`,value:`table_data`,checked:E===`table_data`,onChange:()=>O(`table_data`)}),e(`database.csv.targetTableData`)]})]})]}),E===`table_data`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsx)(r,{htmlFor:`csv-database`,children:e(`database.csv.database`)}),(0,F.jsxs)(g,{value:R,onValueChange:z,disabled:j.length===0,children:[(0,F.jsx)(p,{id:`csv-database`,className:`w-full`,children:(0,F.jsx)(f,{placeholder:e(`database.csv.databasePlaceholder`)})}),(0,F.jsx)(m,{children:j.map(e=>(0,F.jsx)(h,{value:e,children:e},e))})]})]}),(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsx)(r,{htmlFor:`csv-table-name`,children:e(`database.csv.tableName`)}),(0,F.jsx)(i,{id:`csv-table-name`,value:k,onChange:e=>A(e.target.value),placeholder:e(`database.csv.tableNamePlaceholder`)})]})]}),(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,F.jsx)(r,{htmlFor:`csv-delimiter`,children:e(`database.csv.delimiter`)}),(0,F.jsxs)(g,{value:B,onValueChange:V,children:[(0,F.jsx)(p,{id:`csv-delimiter`,className:`w-full`,children:(0,F.jsx)(f,{})}),(0,F.jsx)(m,{children:I.map(t=>(0,F.jsx)(h,{value:t.value,children:e(t.label)},t.value))})]})]}),(0,F.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>U(e.target.checked)}),e(`database.csv.includeHeaders`)]})]}),K&&(0,F.jsxs)(`div`,{className:`space-y-1`,children:[(0,F.jsx)(t,{value:oe??0}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:K.total===null?e(`database.csv.progressUnknown`,{loaded:K.loaded}):e(`database.csv.progress`,{loaded:K.loaded,total:K.total})})]}),J&&(0,F.jsx)(`p`,{className:`text-sm text-destructive whitespace-pre-wrap`,children:J}),(0,F.jsxs)(te,{children:[(0,F.jsx)(d,{variant:`outline`,onClick:()=>$(!1),children:e(W?`database.csv.stop`:`database.csv.cancel`)}),(0,F.jsx)(d,{onClick:ae,disabled:W||E===`table_data`&&!k.trim(),children:e(W?`database.csv.downloading`:`database.csv.download`)})]})]})})}export{L as DownloadToCSVDialog};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,C as n,D as r,E as i,K as a,S as o,T as s,b as c,c as l,kt as u,l as d,v as f,w as p,x as m,y as h}from"./main-BPskUSLM.js";import{h as g,n as _,t as v}from"./ui-store-5IssrgmG.js";import{l as y,m as b,t as x}from"./button-B2EsmMJs.js";import{a as S,i as C,n as w,r as T,t as E}from"./select-C3A-RS4G.js";import{t as D}from"./connection-store-Ds9Gjt3K.js";import{a as ee}from"./database-eJWHFM-2.js";import{n as O}from"./engine-DtZy_Zk0.js";import{c as te,f as ne}from"./query-execution-C5QxvBZj.js";import{n as k,t as A}from"./use-engine-CxcEyIko.js";import{i as re}from"./table-copy-BJBmJ9OO.js";import{a as j,i as M,n as N,o as P,t as F}from"./dialog-FBpgH0QJ.js";var I=e(g(),1);function L(){return{id:crypto.randomUUID(),field:``,type:`varchar`,length:``,defaultValue:``,pk:!1,notNull:!1,unsigned:!1,autoIncrement:!1,zerofill:!1,comment:``}}function R(){return{id:crypto.randomUUID(),name:``,type:`INDEX`,columns:[]}}function z(){return{engine:`InnoDB`,charset:`utf8mb4`,collation:`utf8mb4_general_ci`,autoIncrement:``,comment:``}}function B(e,t,n,r,i){return{database:e,name:t,columns:n.map(e=>({name:e.field,type:e.type,length:e.length,defaultValue:e.defaultValue,primaryKey:e.pk,notNull:e.notNull,unsigned:e.unsigned,autoIncrement:e.autoIncrement,zerofill:e.zerofill,comment:e.comment})),indexes:r.map(e=>({name:e.name,type:e.type,columns:[...e.columns]})),options:{...i}}}var V=y(),H=`w-auto min-w-full [&_td]:bg-muted [&_td]:border-r [&_td]:border-border/60 [&_td:last-child]:border-r-0 [&_td]:p-0 [&_td]:h-8 [&_tr:nth-child(even)_td]:bg-muted/60 [&_tr:focus-within_td]:bg-primary/5`,U=`sticky top-0 z-10 bg-catppuccin-crust shadow-[inset_0_-1px_0_var(--border)] [&_th]:h-8 [&_th]:bg-catppuccin-crust [&_th]:font-semibold [&_th]:text-foreground [&_th]:uppercase [&_th]:tracking-wide [&_th]:text-[11px]`,W=`h-8 w-full min-w-0 rounded-none border-0 bg-transparent px-2 text-xs shadow-none ring-0 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary dark:bg-transparent`,G=`h-8 w-full min-w-0 rounded-none border-0 bg-transparent px-2 text-xs shadow-none focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary data-[state=open]:bg-primary/10 dark:bg-transparent dark:hover:bg-transparent`;function ie({columns:e,onChange:r}){let{t:i}=b(),a=A().getDataTypes(),s=(0,I.useCallback)((t,n,i)=>{r(e.map(e=>e.id===t?{...e,[n]:i}:e))},[e,r]);function l(){r([...e,L()])}function u(){e.length>0&&r(e.slice(0,-1))}return(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsx)(t,{className:`flex-1`,children:(0,V.jsxs)(f,{className:H,children:[(0,V.jsx)(o,{className:U,children:(0,V.jsxs)(n,{children:[(0,V.jsx)(m,{className:`w-[120px]`,children:i(`table.schema.colField`)}),(0,V.jsx)(m,{className:`w-[120px]`,children:i(`table.schema.colType`)}),(0,V.jsx)(m,{className:`w-[60px]`,children:i(`table.schema.colLength`)}),(0,V.jsx)(m,{className:`w-[100px]`,children:i(`table.schema.colDefault`)}),(0,V.jsx)(m,{className:`w-[40px]`,children:i(`table.schema.colPk`)}),(0,V.jsx)(m,{className:`w-[60px]`,children:i(`table.schema.colNotNull`)}),(0,V.jsx)(m,{className:`w-[60px]`,children:i(`table.schema.colUnsigned`)}),(0,V.jsx)(m,{className:`w-[70px]`,children:i(`table.schema.colAutoIncrement`)}),(0,V.jsx)(m,{className:`w-[60px]`,children:i(`table.schema.colZerofill`)}),(0,V.jsx)(m,{children:i(`table.schema.colComment`)})]})}),(0,V.jsx)(h,{children:e.length===0?(0,V.jsx)(n,{children:(0,V.jsx)(c,{colSpan:10,className:`text-center text-muted-foreground`,children:i(`table.schema.empty`)})}):e.map(e=>(0,V.jsxs)(n,{children:[(0,V.jsx)(c,{children:(0,V.jsx)(d,{className:W,value:e.field,onChange:t=>s(e.id,`field`,t.target.value),placeholder:`column_name`})}),(0,V.jsx)(c,{children:(0,V.jsxs)(E,{value:e.type,onValueChange:t=>s(e.id,`type`,t),children:[(0,V.jsx)(C,{className:G,children:(0,V.jsx)(S,{})}),(0,V.jsx)(w,{children:a.map(e=>(0,V.jsx)(T,{value:e,children:e},e))})]})}),(0,V.jsx)(c,{children:(0,V.jsx)(d,{className:W,value:e.length,onChange:t=>s(e.id,`length`,t.target.value)})}),(0,V.jsx)(c,{children:(0,V.jsx)(d,{className:W,value:e.defaultValue,onChange:t=>s(e.id,`defaultValue`,t.target.value),placeholder:`NULL`})}),(0,V.jsx)(c,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.pk,onChange:t=>s(e.id,`pk`,t.target.checked)})}),(0,V.jsx)(c,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.notNull,onChange:t=>s(e.id,`notNull`,t.target.checked)})}),(0,V.jsx)(c,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.unsigned,onChange:t=>s(e.id,`unsigned`,t.target.checked)})}),(0,V.jsx)(c,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.autoIncrement,onChange:t=>s(e.id,`autoIncrement`,t.target.checked)})}),(0,V.jsx)(c,{className:`text-center`,children:(0,V.jsx)(`input`,{type:`checkbox`,checked:e.zerofill,onChange:t=>s(e.id,`zerofill`,t.target.checked)})}),(0,V.jsx)(c,{children:(0,V.jsx)(d,{className:W,value:e.comment,onChange:t=>s(e.id,`comment`,t.target.value)})})]},e.id))})]})}),(0,V.jsxs)(`div`,{className:`flex gap-2 p-2 border-t`,children:[(0,V.jsx)(x,{size:`sm`,variant:`outline`,onClick:l,children:i(`table.schema.add`)}),(0,V.jsx)(x,{size:`sm`,variant:`outline`,onClick:u,disabled:e.length===0,children:i(`table.schema.remove`)})]})]})}var K=[`PRIMARY`,`UNIQUE`,`INDEX`,`FULLTEXT`];function q({open:e,index:t,availableColumns:n,onSave:r,onClose:i}){let{t:a}=b(),[o,s]=(0,I.useState)(t.name),[c,u]=(0,I.useState)(t.type),[f,p]=(0,I.useState)(t.columns);function m(e){p(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}function h(){r({id:t.id,name:c===`PRIMARY`?`PRIMARY`:o,type:c,columns:f})}return(0,V.jsx)(F,{open:e,onOpenChange:e=>{e||i()},children:(0,V.jsxs)(N,{className:`sm:max-w-[500px]`,children:[(0,V.jsx)(j,{children:(0,V.jsx)(P,{children:t.name?a(`table.index.editTitle`):a(`table.index.addTitle`)})}),(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`idx-name`,children:a(`table.index.name`)}),(0,V.jsx)(d,{id:`idx-name`,value:c===`PRIMARY`?`PRIMARY`:o,onChange:e=>s(e.target.value),disabled:c===`PRIMARY`,placeholder:a(`table.index.namePlaceholder`)})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`idx-type`,children:a(`table.index.type`)}),(0,V.jsxs)(E,{value:c,onValueChange:e=>u(e),children:[(0,V.jsx)(C,{id:`idx-type`,className:`w-full`,children:(0,V.jsx)(S,{})}),(0,V.jsx)(w,{children:K.map(e=>(0,V.jsx)(T,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{children:a(`table.index.columns`)}),(0,V.jsx)(`div`,{className:`border rounded-md p-2 max-h-[200px] overflow-y-auto space-y-1`,children:n.length===0?(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a(`table.index.noColumns`)}):n.map(e=>(0,V.jsxs)(`label`,{className:`flex items-center gap-2 text-sm cursor-pointer hover:bg-muted/50 rounded px-1 py-0.5`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:f.includes(e.field),onChange:()=>m(e.field)}),(0,V.jsx)(`span`,{children:e.field||a(`table.index.unnamed`)}),(0,V.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.type,`)`]})]},e.id))})]})]}),(0,V.jsxs)(M,{children:[(0,V.jsx)(x,{variant:`outline`,onClick:i,children:a(`table.index.cancel`)}),(0,V.jsx)(x,{onClick:h,disabled:f.length===0,children:a(`table.index.ok`)})]})]})})}function ae({indexes:e,availableColumns:r,onChange:i}){let{t:a}=b(),[s,l]=(0,I.useState)(null),[u,d]=(0,I.useState)(!1);function p(){let e=R();l(e),d(!0)}function g(e){l({...e}),d(!0)}function _(){e.length>0&&i(e.slice(0,-1))}function v(t){e.find(e=>e.id===t.id)?i(e.map(e=>e.id===t.id?t:e)):i([...e,t]),d(!1),l(null)}function y(){d(!1),l(null)}return(0,V.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,V.jsx)(t,{className:`flex-1`,children:(0,V.jsxs)(f,{className:H+` [&_td]:px-2`,children:[(0,V.jsx)(o,{className:U,children:(0,V.jsxs)(n,{children:[(0,V.jsx)(m,{className:`w-[150px]`,children:a(`table.indexes.colName`)}),(0,V.jsx)(m,{className:`w-[120px]`,children:a(`table.indexes.colType`)}),(0,V.jsx)(m,{children:a(`table.indexes.colColumns`)})]})}),(0,V.jsx)(h,{children:e.length===0?(0,V.jsx)(n,{children:(0,V.jsx)(c,{colSpan:3,className:`text-center text-muted-foreground`,children:a(`table.indexes.empty`)})}):e.map(e=>(0,V.jsxs)(n,{className:`cursor-pointer`,onDoubleClick:()=>g(e),children:[(0,V.jsx)(c,{children:e.name}),(0,V.jsx)(c,{children:e.type}),(0,V.jsx)(c,{children:e.columns.join(`, `)})]},e.id))})]})}),(0,V.jsxs)(`div`,{className:`flex gap-2 p-2 border-t`,children:[(0,V.jsx)(x,{size:`sm`,variant:`outline`,onClick:p,children:a(`table.indexes.add`)}),(0,V.jsx)(x,{size:`sm`,variant:`outline`,onClick:_,disabled:e.length===0,children:a(`table.indexes.remove`)})]}),s&&(0,V.jsx)(q,{open:u,index:s,availableColumns:r,onSave:v,onClose:y})]})}var J=[`InnoDB`,`MyISAM`,`MEMORY`,`CSV`,`ARCHIVE`,`BLACKHOLE`,`MRG_MYISAM`,`FEDERATED`,`PERFORMANCE_SCHEMA`],Y=[`utf8mb4`,`utf8`,`latin1`,`ascii`,`binary`,`cp1251`,`euckr`,`gb2312`,`gbk`,`sjis`,`ucs2`,`utf16`,`utf32`],X={utf8mb4:[`utf8mb4_general_ci`,`utf8mb4_unicode_ci`,`utf8mb4_bin`,`utf8mb4_0900_ai_ci`],utf8:[`utf8_general_ci`,`utf8_unicode_ci`,`utf8_bin`],latin1:[`latin1_swedish_ci`,`latin1_general_ci`,`latin1_bin`],ascii:[`ascii_general_ci`,`ascii_bin`],binary:[`binary`],cp1251:[`cp1251_general_ci`,`cp1251_bin`],euckr:[`euckr_korean_ci`,`euckr_bin`],gb2312:[`gb2312_chinese_ci`,`gb2312_bin`],gbk:[`gbk_chinese_ci`,`gbk_bin`],sjis:[`sjis_japanese_ci`,`sjis_bin`],ucs2:[`ucs2_general_ci`,`ucs2_unicode_ci`,`ucs2_bin`],utf16:[`utf16_general_ci`,`utf16_unicode_ci`,`utf16_bin`],utf32:[`utf32_general_ci`,`utf32_unicode_ci`,`utf32_bin`]};function oe({properties:e,onChange:t}){let{t:n}=b();function r(n,r){let i={...e,[n]:r};n===`charset`&&(i.collation=X[r]?.[0]??``),t(i)}let i=X[e.charset]??[];return(0,V.jsxs)(`div`,{className:`p-4 space-y-4`,children:[(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`prop-engine`,children:n(`table.properties.engine`)}),(0,V.jsxs)(E,{value:e.engine,onValueChange:e=>r(`engine`,e),children:[(0,V.jsx)(C,{id:`prop-engine`,className:`w-full`,children:(0,V.jsx)(S,{})}),(0,V.jsx)(w,{children:J.map(e=>(0,V.jsx)(T,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`prop-charset`,children:n(`table.properties.charset`)}),(0,V.jsxs)(E,{value:e.charset,onValueChange:e=>r(`charset`,e),children:[(0,V.jsx)(C,{id:`prop-charset`,className:`w-full`,children:(0,V.jsx)(S,{})}),(0,V.jsx)(w,{children:Y.map(e=>(0,V.jsx)(T,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`prop-collation`,children:n(`table.properties.collation`)}),(0,V.jsxs)(E,{value:e.collation,onValueChange:e=>r(`collation`,e),children:[(0,V.jsx)(C,{id:`prop-collation`,className:`w-full`,children:(0,V.jsx)(S,{})}),(0,V.jsx)(w,{children:i.map(e=>(0,V.jsx)(T,{value:e,children:e},e))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`prop-auto-incr`,children:n(`table.properties.autoIncrement`)}),(0,V.jsx)(d,{id:`prop-auto-incr`,type:`number`,value:e.autoIncrement,onChange:e=>r(`autoIncrement`,e.target.value),placeholder:n(`table.properties.autoIncrementPlaceholder`)})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)(l,{htmlFor:`prop-comment`,children:n(`table.properties.comment`)}),(0,V.jsx)(d,{id:`prop-comment`,value:e.comment,onChange:e=>r(`comment`,e.target.value)})]})]})}function se({connectionId:e,database:t,tableName:n,columns:r,indexes:i,properties:o}){let s=a(e=>e.themeId),c=k(e),l=s===`light`||s===`light-blue`||s===`solarized-light`?`vs`:`vs-dark`,d=(0,I.useMemo)(()=>c.ddl.createTable(B(t,n,r,i,o)),[c,t,n,r,i,o]);return(0,V.jsx)(`div`,{className:`h-[320px]`,children:(0,V.jsx)(u,{height:`100%`,language:`sql`,theme:l,value:d,options:{readOnly:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,lineNumbers:`on`,wordWrap:`on`}})})}function Z(e){return JSON.stringify([e.type,e.length,e.defaultValue,e.pk,e.notNull,e.unsigned,e.autoIncrement,e.zerofill,e.comment])}function Q(e){return{name:e.field,type:e.length?`${e.type}(${e.length})`:e.type,nullable:!e.notNull,key:e.pk?`PRI`:``,defaultValue:e.defaultValue===``?null:e.defaultValue,extra:e.autoIncrement?`auto_increment`:``,comment:e.comment,collation:null}}function $(e){return{name:e.name,type:e.type,columns:[...e.columns]}}function ce(e,t){return e.name===t.name&&e.type===t.type&&e.columns.join(`,`)===t.columns.join(`,`)}function le({engine:e,database:t,table:n,before:r,after:i}){let{ddl:a}=e,o=[],s=[],c=[],l=new Map(r.columns.map(e=>[e.id,e])),u=new Map(i.columns.map(e=>[e.id,e])),d=new Map(r.indexes.map(e=>[e.id,e])),f=new Map(i.indexes.map(e=>[e.id,e])),p=[];for(let[e,r]of d){let i=f.get(e);i?ce(r,i)||(o.push(a.dropIndex(t,n,r.name)),p.push(i)):o.push(a.dropIndex(t,n,r.name))}for(let[e,r]of u){let i=l.get(e);if(!i){r.field.trim()&&o.push(a.addColumn(t,n,Q(r)));continue}if(i.field!==r.field&&o.push(a.renameColumn(t,n,i.field,r.field)),Z(i)!==Z(r)){let e=a.alterColumn(t,n,Q(r));e?o.push(e):c.push(r.field)}}for(let[e,r]of l)if(!u.has(e)){let e=a.dropColumn(t,n,r.field);o.push(e),s.push(e)}for(let e of p)o.push(a.createIndex(t,n,$(e)));for(let[e,r]of f)!d.has(e)&&r.columns.length>0&&o.push(a.createIndex(t,n,$(r)));return{statements:o,destructive:s,unsupported:c}}function ue(){let{t:e}=b(),{activeDialog:t,closeDialog:n}=_(),a=v(`create-table`,`alter-table`,`duplicate-table-structure`),o=t===`create-table`||t===`alter-table`||t===`duplicate-table-structure`,c=t===`alter-table`,u=t===`duplicate-table-structure`,f=a?.nodeText??``,m=a?.metadata?.database??``,[h,g]=(0,I.useState)(``),[y,S]=(0,I.useState)([L()]),[C,w]=(0,I.useState)([]),[T,E]=(0,I.useState)(z()),[A,R]=(0,I.useState)(!1),[H,U]=(0,I.useState)(!1),[W,G]=(0,I.useState)(null),[K,q]=(0,I.useState)(null),J=a?.connectionId??D.getState().activeConnectionId,Y=k(J);(0,I.useEffect)(()=>{o&&(G(null),q(null),c||u?(g(u?`${f}_copy`:f),X()):(g(``),S([L()]),w([]),E(z())))},[o,t]);async function X(){let e=D.getState(),t=a?.connectionId??e.activeConnectionId,n=e.activeConnections.find(e=>e.id===t)?.serverConnectionId;if(!n||!m||!f)return;R(!0);let{introspect:r,capabilities:i}=O(t),o=ee(n);try{let e=await r.listColumns(o,m,f),t=[];if(e.length>0){let n=e.map(e=>{let t=e.type,n=t.match(/^(\w+)(?:\(([^)]+)\))?/);return{id:crypto.randomUUID(),field:e.name,type:n?.[1]?.toLowerCase()??t.toLowerCase(),length:n?.[2]??``,defaultValue:e.defaultValue??``,pk:e.key===`PRI`,notNull:!e.nullable,unsigned:t.includes(`unsigned`),autoIncrement:e.extra.includes(`auto_increment`),zerofill:t.includes(`zerofill`),comment:e.comment}});S(n),t=n}let n=await r.listIndexes(o,m,f),a=[];if(n.length>0&&(a=n.map(e=>({id:crypto.randomUUID(),name:e.name,type:e.type===`SPATIAL`?`INDEX`:e.type,columns:[...e.columns]})),w(a)),q({columns:t,indexes:a}),i.tableProperties){let e=await r.getTableInfo(o,m,f);e&&E({engine:e.engine??`InnoDB`,charset:(e.collation??`utf8mb4`).replace(/_.*/,``),collation:e.collation??`utf8mb4_unicode_ci`,autoIncrement:e.autoIncrement??``,comment:e.comment})}}catch(e){console.error(`Failed to load table schema:`,e),G(e instanceof Error?e.message:String(e))}finally{R(!1)}}function Z(e){e||n()}async function Q(){let t=a?.connectionId??D.getState().activeConnectionId;if(!t||!h.trim())return;let r=O(t);G(null);let i,o=[];if(c){if(!K)return;let t=le({engine:r,database:m,table:f,before:K,after:{columns:y,indexes:C}});if(t.unsupported.length>0){G(e(`table.dialog.cannotAlterColumns`,{engine:r.label,columns:t.unsupported.join(`, `)}));return}if(t.statements.length===0){n();return}i=t.statements.join(`
|
|
2
|
+
`),o=t.destructive}else{let e=u?C.map(e=>({...e,name:re(e.name,f,h.trim())})):C;i=r.ddl.createTable(B(m,h.trim(),y,e,T))}U(!0);try{await te(t,i,{skipDestructiveConfirm:o.length===0}),await ne(t,m),n()}catch(e){G(e instanceof Error?e.message:String(e))}finally{U(!1)}}let $=e(c?`table.dialog.alterTitle`:u?`table.dialog.duplicateTitle`:`table.dialog.createTitle`),ce=e(c?`table.dialog.alter`:`table.dialog.create`);return(0,V.jsx)(F,{open:o,onOpenChange:Z,children:(0,V.jsxs)(N,{className:`sm:max-w-[1000px] max-h-[80vh] flex flex-col`,children:[(0,V.jsx)(j,{children:(0,V.jsx)(P,{children:$})}),(0,V.jsxs)(`div`,{className:`space-y-3 flex-1 overflow-hidden flex flex-col min-h-0`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5 px-1`,children:[(0,V.jsx)(l,{htmlFor:`table-name`,children:e(`table.dialog.tableName`)}),(0,V.jsx)(d,{id:`table-name`,value:h,onChange:e=>g(e.target.value),placeholder:e(`table.dialog.tableNamePlaceholder`),disabled:c})]}),A?(0,V.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:e(`table.dialog.loading`)}):(0,V.jsxs)(p,{defaultValue:`schema`,className:`flex-1 min-h-0 flex flex-col`,children:[(0,V.jsxs)(i,{children:[(0,V.jsx)(r,{value:`schema`,children:e(`table.dialog.tabSchema`)}),(0,V.jsx)(r,{value:`indexes`,children:e(`table.dialog.tabIndexes`)}),Y.capabilities.tableProperties&&(0,V.jsx)(r,{value:`properties`,children:e(`table.dialog.tabProperties`)}),(0,V.jsx)(r,{value:`sql`,children:`SQL`})]}),(0,V.jsx)(s,{value:`schema`,className:`flex-1 min-h-0 overflow-auto border rounded-md`,children:(0,V.jsx)(ie,{columns:y,onChange:S})}),(0,V.jsx)(s,{value:`indexes`,className:`flex-1 min-h-0 overflow-auto border rounded-md`,children:(0,V.jsx)(ae,{indexes:C,availableColumns:y,onChange:w})}),(0,V.jsx)(s,{value:`properties`,className:`flex-1 min-h-0 overflow-auto border rounded-md`,children:(0,V.jsx)(oe,{properties:T,onChange:E})}),(0,V.jsx)(s,{value:`sql`,className:`flex-1 min-h-0 border rounded-md`,children:(0,V.jsx)(se,{connectionId:J,database:m,tableName:h,columns:y,indexes:C,properties:T})})]})]}),W&&(0,V.jsx)(`p`,{className:`px-1 text-xs text-destructive leading-relaxed`,children:W}),(0,V.jsxs)(M,{children:[(0,V.jsx)(x,{variant:`outline`,onClick:()=>Z(!1),children:e(`table.dialog.cancel`)}),(0,V.jsx)(x,{onClick:()=>void Q(),disabled:A||H||!h.trim(),children:H?e(`table.dialog.applying`):ce})]})]})})}export{ue as EditSchemaDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ct as t,c as n,l as r}from"./main-BPskUSLM.js";import{h as i,n as a}from"./ui-store-5IssrgmG.js";import{i as o,l as s,m as c,t as l}from"./button-B2EsmMJs.js";import{t as u}from"./chevron-up-CBnVjNE1.js";import{t as d}from"./connection-store-Ds9Gjt3K.js";import{n as f}from"./query-store-BR6Saeed.js";import{n as p,o as m,s as h,t as g}from"./editor-registry-ukUyoekH.js";var _=e(i(),1),v=s();function y(){let{t:e}=c(),{activeDialog:i,closeDialog:s}=a(),[y,b]=(0,_.useState)(``),[x,S]=(0,_.useState)(``),[C,w]=(0,_.useState)(!1),[T,E]=(0,_.useState)(!1),[D,O]=(0,_.useState)(!1),[k,A]=(0,_.useState)(0),j=d(e=>e.activeConnectionId)??``,M=f(e=>j?e.activeTabId[j]:void 0)??``;if(i!==`find-replace`)return null;let N={query:y,caseSensitive:C,regex:T,wholeWord:D},P=j!==``&&M!==``&&y!==``;function F(){s()}function I(){A(P?p(j,M,N,`next`):0)}function L(){A(P?p(j,M,N,`prev`):0)}function R(){P&&A(h(j,M,N,x))}function z(){P&&(m(j,M,N,x),A(g(j,M,N)))}return(0,v.jsxs)(`div`,{className:`fixed top-12 right-4 z-50 bg-background border rounded-md shadow-lg p-3 w-[400px] space-y-2`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(r,{placeholder:e(`command.findReplace.findPlaceholder`),value:y,onChange:e=>b(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.shiftKey?L():I()),e.key===`Escape`&&F()},className:`flex-1 h-7 text-sm`,autoFocus:!0}),(0,v.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap min-w-[60px] text-center`,children:k>0?e(`command.findReplace.found`,{count:k}):e(`command.findReplace.noResults`)}),(0,v.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,onClick:L,title:e(`command.findReplace.previous`),children:(0,v.jsx)(u,{className:`h-4 w-4`})}),(0,v.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,onClick:I,title:e(`command.findReplace.next`),children:(0,v.jsx)(t,{className:`h-4 w-4`})}),(0,v.jsx)(l,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,onClick:F,title:e(`command.findReplace.close`),children:(0,v.jsx)(o,{className:`h-4 w-4`})})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(r,{placeholder:e(`command.findReplace.replacePlaceholder`),value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Escape`&&F()},className:`flex-1 h-7 text-sm`}),(0,v.jsx)(l,{variant:`outline`,size:`sm`,className:`h-7 text-xs`,onClick:R,children:e(`command.findReplace.replace`)}),(0,v.jsx)(l,{variant:`outline`,size:`sm`,className:`h-7 text-xs`,onClick:z,children:e(`command.findReplace.all`)})]}),(0,v.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,v.jsxs)(n,{className:`flex items-center gap-1.5 text-xs font-normal cursor-pointer`,children:[(0,v.jsx)(`input`,{type:`checkbox`,checked:C,onChange:e=>w(e.target.checked),className:`rounded border-input`}),e(`command.findReplace.caseSensitive`)]}),(0,v.jsxs)(n,{className:`flex items-center gap-1.5 text-xs font-normal cursor-pointer`,children:[(0,v.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>E(e.target.checked),className:`rounded border-input`}),e(`command.findReplace.regex`)]}),(0,v.jsxs)(n,{className:`flex items-center gap-1.5 text-xs font-normal cursor-pointer`,children:[(0,v.jsx)(`input`,{type:`checkbox`,checked:D,onChange:e=>O(e.target.checked),className:`rounded border-input`}),e(`command.findReplace.wholeWord`)]})]})]})}export{y as FindReplaceDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./ui-store-
|
|
1
|
+
import{n as e}from"./ui-store-5IssrgmG.js";import{l as t,m as n,t as r}from"./button-B2EsmMJs.js";import{t as i}from"./connection-store-Ds9Gjt3K.js";import{c as a}from"./database-eJWHFM-2.js";import{a as o,i as s,n as c,o as l,t as u}from"./dialog-FBpgH0QJ.js";var d=t(),f=[`FLUSH HOSTS`,`FLUSH LOGS`,`FLUSH PRIVILEGES`,`FLUSH STATUS`,`FLUSH TABLES`,`FLUSH THREADS`,`FLUSH QUERY CACHE`,`FLUSH DES_KEY_FILE`,`FLUSH RELAY LOGS`,`FLUSH SLOW LOGS`,`FLUSH BINARY LOGS`,`FLUSH ENGINE LOGS`,`FLUSH ERROR LOGS`,`FLUSH GENERAL LOGS`,`FLUSH USER_RESOURCES`,`FLUSH OPTIMIZER_COSTS`];function p(){let e=i.getState();return e.activeConnections.find(t=>t.id===e.activeConnectionId)?.serverConnectionId??null}function m(){let{t}=n(),{activeDialog:i,closeDialog:m,setFooterMessage:h}=e(),g=i===`flush`;function _(e){e||m()}async function v(e){let n=p();if(!n){h(t(`command.noActiveConnection`));return}try{await a(n,e),h(t(`command.flush.executed`,{command:e}))}catch(n){h(t(`command.flush.executeError`,{command:e,message:n instanceof Error?n.message:String(n)}))}}return(0,d.jsx)(u,{open:g,onOpenChange:_,children:(0,d.jsxs)(c,{className:`sm:max-w-[500px]`,children:[(0,d.jsx)(o,{children:(0,d.jsx)(l,{children:t(`command.flush.title`)})}),(0,d.jsx)(`div`,{className:`grid grid-cols-2 gap-2 py-2`,children:f.map(e=>(0,d.jsx)(r,{variant:`outline`,size:`sm`,className:`justify-start text-xs h-8`,onClick:()=>{v(e)},children:e},e))}),(0,d.jsx)(s,{children:(0,d.jsx)(r,{variant:`outline`,onClick:()=>_(!1),children:t(`command.close`)})})]})})}export{m as FlushDialog};
|