fdb2 1.0.38 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/bin/fdb2.js +78 -3
- package/dist/public/explorer.css +403 -380
- package/dist/public/explorer.js +1294 -737
- package/dist/public/index.js +242 -16
- package/dist/public/layout.js +1 -1
- package/dist/scripts/verify-db-support.cjs +239 -0
- package/dist/server/core/dialect.d.ts +9 -0
- package/dist/server/core/dialect.d.ts.map +1 -1
- package/dist/server/core/dialect.js +24 -9
- package/dist/server/core/dialect.js.map +1 -1
- package/dist/server/core/dialect.ts +29 -9
- package/dist/server/core/schema/__tests__/ddl-emitter.test.ts +7 -3
- package/dist/server/core/schema/ddl-emitter.d.ts.map +1 -1
- package/dist/server/core/schema/ddl-emitter.js +32 -12
- package/dist/server/core/schema/ddl-emitter.js.map +1 -1
- package/dist/server/core/schema/ddl-emitter.ts +34 -11
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +83 -6
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.ts +87 -6
- package/dist/server/model/ddl-spec.d.ts +9 -0
- package/dist/server/model/ddl-spec.d.ts.map +1 -1
- package/dist/server/model/ddl-spec.ts +9 -0
- package/dist/server/service/connection.service.d.ts +8 -0
- package/dist/server/service/connection.service.d.ts.map +1 -1
- package/dist/server/service/connection.service.js +75 -17
- package/dist/server/service/connection.service.js.map +1 -1
- package/dist/server/service/connection.service.ts +74 -17
- package/dist/server/service/database/base.service.d.ts +45 -0
- package/dist/server/service/database/base.service.d.ts.map +1 -1
- package/dist/server/service/database/base.service.js +120 -7
- package/dist/server/service/database/base.service.js.map +1 -1
- package/dist/server/service/database/base.service.ts +143 -8
- package/dist/server/service/database/cockroachdb.service.d.ts +9 -0
- package/dist/server/service/database/cockroachdb.service.d.ts.map +1 -1
- package/dist/server/service/database/cockroachdb.service.js +67 -56
- package/dist/server/service/database/cockroachdb.service.js.map +1 -1
- package/dist/server/service/database/cockroachdb.service.ts +66 -57
- package/dist/server/service/database/database.service.d.ts +3 -221
- package/dist/server/service/database/database.service.d.ts.map +1 -1
- package/dist/server/service/database/database.service.js +66 -24
- package/dist/server/service/database/database.service.js.map +1 -1
- package/dist/server/service/database/database.service.ts +69 -23
- package/dist/server/service/database/mongodb.service.d.ts +58 -3
- package/dist/server/service/database/mongodb.service.d.ts.map +1 -1
- package/dist/server/service/database/mongodb.service.js +251 -54
- package/dist/server/service/database/mongodb.service.js.map +1 -1
- package/dist/server/service/database/mongodb.service.ts +275 -60
- package/dist/server/service/database/mssql.service.d.ts +8 -0
- package/dist/server/service/database/mssql.service.d.ts.map +1 -1
- package/dist/server/service/database/mssql.service.js +41 -36
- package/dist/server/service/database/mssql.service.js.map +1 -1
- package/dist/server/service/database/mssql.service.ts +45 -40
- package/dist/server/service/database/oracle.service.d.ts +24 -0
- package/dist/server/service/database/oracle.service.d.ts.map +1 -1
- package/dist/server/service/database/oracle.service.js +146 -106
- package/dist/server/service/database/oracle.service.js.map +1 -1
- package/dist/server/service/database/oracle.service.ts +145 -105
- package/dist/server/service/database/sqlite.service.js +1 -1
- package/dist/server/service/database/sqlite.service.js.map +1 -1
- package/dist/server/service/database/sqlite.service.ts +1 -1
- package/package.json +8 -8
- package/scripts/verify-db-support.cjs +239 -0
package/dist/public/explorer.js
CHANGED
|
@@ -132,6 +132,42 @@ var init_database = __esmMin((() => {
|
|
|
132
132
|
orderBy
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
+
/** 获取集合索引列表 */
|
|
136
|
+
async getIndexes(connectionId, databaseName, tableName) {
|
|
137
|
+
return request("/api/database/getIndexes", {
|
|
138
|
+
id: connectionId,
|
|
139
|
+
database: databaseName,
|
|
140
|
+
table: tableName
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
/** 创建索引:keys 形如 { name: 1 } */
|
|
144
|
+
async createIndex(connectionId, databaseName, tableName, keys, options) {
|
|
145
|
+
return request("/api/database/createIndex", {
|
|
146
|
+
id: connectionId,
|
|
147
|
+
database: databaseName,
|
|
148
|
+
table: tableName,
|
|
149
|
+
keys,
|
|
150
|
+
options
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** 删除索引 */
|
|
154
|
+
async dropIndex(connectionId, databaseName, tableName, indexName) {
|
|
155
|
+
return request("/api/database/dropIndex", {
|
|
156
|
+
id: connectionId,
|
|
157
|
+
database: databaseName,
|
|
158
|
+
table: tableName,
|
|
159
|
+
indexName
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/** 执行聚合管道 */
|
|
163
|
+
async aggregate(connectionId, databaseName, tableName, pipeline) {
|
|
164
|
+
return request("/api/database/aggregate", {
|
|
165
|
+
id: connectionId,
|
|
166
|
+
database: databaseName,
|
|
167
|
+
table: tableName,
|
|
168
|
+
pipeline
|
|
169
|
+
});
|
|
170
|
+
}
|
|
135
171
|
/**
|
|
136
172
|
* 执行SQL查询
|
|
137
173
|
*/
|
|
@@ -269,24 +305,26 @@ var init_database = __esmMin((() => {
|
|
|
269
305
|
/**
|
|
270
306
|
* 更新数据
|
|
271
307
|
*/
|
|
272
|
-
async updateData(connectionId, database, tableName, data, where) {
|
|
308
|
+
async updateData(connectionId, database, tableName, data, where, docId) {
|
|
273
309
|
return request("/api/database/updateData", {
|
|
274
310
|
id: connectionId,
|
|
275
311
|
database,
|
|
276
312
|
table: tableName,
|
|
277
313
|
data,
|
|
278
|
-
where
|
|
314
|
+
where,
|
|
315
|
+
...docId !== void 0 ? { docId } : {}
|
|
279
316
|
});
|
|
280
317
|
}
|
|
281
318
|
/**
|
|
282
319
|
* 删除数据
|
|
283
320
|
*/
|
|
284
|
-
async deleteData(connectionId, database, tableName, where) {
|
|
321
|
+
async deleteData(connectionId, database, tableName, where, docId) {
|
|
285
322
|
return request("/api/database/deleteData", {
|
|
286
323
|
id: connectionId,
|
|
287
324
|
database,
|
|
288
325
|
table: tableName,
|
|
289
|
-
where
|
|
326
|
+
where,
|
|
327
|
+
...docId !== void 0 ? { docId } : {}
|
|
290
328
|
});
|
|
291
329
|
}
|
|
292
330
|
/**
|
|
@@ -477,33 +515,33 @@ var init_database = __esmMin((() => {
|
|
|
477
515
|
}));
|
|
478
516
|
//#endregion
|
|
479
517
|
//#region src/components/connection-editor/index.vue?vue&type=script&setup=true&lang.ts
|
|
480
|
-
var _hoisted_1$
|
|
518
|
+
var _hoisted_1$10, _hoisted_2$10, _hoisted_3$10, _hoisted_4$10, _hoisted_5$10, _hoisted_6$10, _hoisted_7$10, _hoisted_8$10, _hoisted_9$10, _hoisted_10$10, _hoisted_11$10, _hoisted_12$10, _hoisted_13$10, _hoisted_14$10, _hoisted_15$10, _hoisted_16$10, _hoisted_17$10, _hoisted_18$9, _hoisted_19$9, _hoisted_20$8, _hoisted_21$8, _hoisted_22$8, _hoisted_23$8, _hoisted_24$8, _hoisted_25$8, _hoisted_26$7, _hoisted_27$7, _hoisted_28$7, _hoisted_29$7, _hoisted_30$7, _hoisted_31$7, _hoisted_32$7, _hoisted_33$7, _hoisted_34$7, _hoisted_35$7, _hoisted_36$6, _hoisted_37$6, _hoisted_38$6, _hoisted_39$6, _hoisted_40$6, _hoisted_41$6, _hoisted_42$6, _hoisted_43$6, _hoisted_44$6, _hoisted_45$6, _hoisted_46$6, _hoisted_47$6, _hoisted_48$5, _hoisted_49$5, _hoisted_50$5, _hoisted_51$5, _hoisted_52$5, _hoisted_53$5, _hoisted_54$5, _hoisted_55$5, _hoisted_56$5, _hoisted_57$5, _hoisted_58$4, _hoisted_59$4, _hoisted_60$4, _hoisted_61$4, _hoisted_62$4, _hoisted_63$4, _hoisted_64$4, _hoisted_65$4, _hoisted_66$4, _hoisted_67$4, _hoisted_68$4, _hoisted_69$4, _hoisted_70$4, _hoisted_71$4, _hoisted_72$4, _hoisted_73$4, index_vue_vue_type_script_setup_true_lang_default;
|
|
481
519
|
var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
482
520
|
init_vue_runtime_esm_bundler();
|
|
483
521
|
init_vue_i18n();
|
|
484
522
|
init_database();
|
|
485
523
|
init_modal$1();
|
|
486
524
|
init_toast();
|
|
487
|
-
_hoisted_1$
|
|
488
|
-
_hoisted_2$
|
|
489
|
-
_hoisted_3$
|
|
490
|
-
_hoisted_4$
|
|
491
|
-
_hoisted_5$
|
|
492
|
-
_hoisted_6$
|
|
493
|
-
_hoisted_7$
|
|
494
|
-
_hoisted_8$
|
|
495
|
-
_hoisted_9$
|
|
496
|
-
_hoisted_10$
|
|
497
|
-
_hoisted_11$
|
|
498
|
-
_hoisted_12$
|
|
499
|
-
_hoisted_13$
|
|
525
|
+
_hoisted_1$10 = { class: "form-section" };
|
|
526
|
+
_hoisted_2$10 = { class: "section-header" };
|
|
527
|
+
_hoisted_3$10 = { class: "section-title" };
|
|
528
|
+
_hoisted_4$10 = { class: "section-content" };
|
|
529
|
+
_hoisted_5$10 = { class: "form-grid" };
|
|
530
|
+
_hoisted_6$10 = { class: "form-group-modern" };
|
|
531
|
+
_hoisted_7$10 = { class: "form-label-modern" };
|
|
532
|
+
_hoisted_8$10 = ["placeholder"];
|
|
533
|
+
_hoisted_9$10 = { class: "form-group-modern" };
|
|
534
|
+
_hoisted_10$10 = { class: "form-label-modern" };
|
|
535
|
+
_hoisted_11$10 = { value: "" };
|
|
536
|
+
_hoisted_12$10 = ["value"];
|
|
537
|
+
_hoisted_13$10 = {
|
|
500
538
|
key: 0,
|
|
501
539
|
class: "form-section"
|
|
502
540
|
};
|
|
503
|
-
_hoisted_14$
|
|
504
|
-
_hoisted_15$
|
|
505
|
-
_hoisted_16$
|
|
506
|
-
_hoisted_17$
|
|
541
|
+
_hoisted_14$10 = { class: "section-header" };
|
|
542
|
+
_hoisted_15$10 = { class: "section-title" };
|
|
543
|
+
_hoisted_16$10 = { class: "section-content" };
|
|
544
|
+
_hoisted_17$10 = { class: "form-grid" };
|
|
507
545
|
_hoisted_18$9 = { class: "form-group-modern" };
|
|
508
546
|
_hoisted_19$9 = { class: "form-label-modern" };
|
|
509
547
|
_hoisted_20$8 = ["placeholder"];
|
|
@@ -516,15 +554,15 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
516
554
|
_hoisted_27$7 = { class: "form-group-modern" };
|
|
517
555
|
_hoisted_28$7 = { class: "form-label-modern" };
|
|
518
556
|
_hoisted_29$7 = ["placeholder"];
|
|
519
|
-
_hoisted_30$
|
|
557
|
+
_hoisted_30$7 = {
|
|
520
558
|
key: 1,
|
|
521
559
|
class: "form-section"
|
|
522
560
|
};
|
|
523
|
-
_hoisted_31$
|
|
524
|
-
_hoisted_32$
|
|
525
|
-
_hoisted_33$
|
|
526
|
-
_hoisted_34$
|
|
527
|
-
_hoisted_35$
|
|
561
|
+
_hoisted_31$7 = { class: "section-header" };
|
|
562
|
+
_hoisted_32$7 = { class: "section-title" };
|
|
563
|
+
_hoisted_33$7 = { class: "section-content" };
|
|
564
|
+
_hoisted_34$7 = { class: "form-grid" };
|
|
565
|
+
_hoisted_35$7 = { class: "form-group-modern" };
|
|
528
566
|
_hoisted_36$6 = { class: "form-label-modern" };
|
|
529
567
|
_hoisted_37$6 = ["placeholder"];
|
|
530
568
|
_hoisted_38$6 = {
|
|
@@ -539,7 +577,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
539
577
|
_hoisted_44$6 = { class: "form-label-modern" };
|
|
540
578
|
_hoisted_45$6 = ["placeholder"];
|
|
541
579
|
_hoisted_46$6 = { class: "form-group-modern" };
|
|
542
|
-
_hoisted_47$
|
|
580
|
+
_hoisted_47$6 = { class: "form-label-modern" };
|
|
543
581
|
_hoisted_48$5 = ["placeholder"];
|
|
544
582
|
_hoisted_49$5 = { class: "form-hint" };
|
|
545
583
|
_hoisted_50$5 = { class: "form-section" };
|
|
@@ -549,7 +587,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
549
587
|
_hoisted_54$5 = { class: "form-grid" };
|
|
550
588
|
_hoisted_55$5 = { class: "form-group-modern" };
|
|
551
589
|
_hoisted_56$5 = { class: "form-label-modern" };
|
|
552
|
-
_hoisted_57$
|
|
590
|
+
_hoisted_57$5 = ["placeholder"];
|
|
553
591
|
_hoisted_58$4 = { class: "form-group-modern" };
|
|
554
592
|
_hoisted_59$4 = { class: "form-label-modern" };
|
|
555
593
|
_hoisted_60$4 = ["placeholder"];
|
|
@@ -571,8 +609,8 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
571
609
|
class: "btn btn-secondary",
|
|
572
610
|
"data-bs-dismiss": "modal"
|
|
573
611
|
};
|
|
574
|
-
_hoisted_72$
|
|
575
|
-
_hoisted_73$
|
|
612
|
+
_hoisted_72$4 = { class: "error-content" };
|
|
613
|
+
_hoisted_73$4 = { class: "error-message" };
|
|
576
614
|
index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
577
615
|
__name: "index",
|
|
578
616
|
props: {
|
|
@@ -815,7 +853,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
815
853
|
onSubmit: withModifiers(saveConnection, ["prevent"]),
|
|
816
854
|
class: "connection-form-modern"
|
|
817
855
|
}, [
|
|
818
|
-
createBaseVNode("div", _hoisted_1$
|
|
856
|
+
createBaseVNode("div", _hoisted_1$10, [createBaseVNode("div", _hoisted_2$10, [_cache[13] || (_cache[13] = createBaseVNode("div", { class: "section-icon" }, [createBaseVNode("i", { class: "bi bi-info-circle" })], -1)), createBaseVNode("h3", _hoisted_3$10, toDisplayString(_ctx.$t("connection.basicInfo")), 1)]), createBaseVNode("div", _hoisted_4$10, [createBaseVNode("div", _hoisted_5$10, [createBaseVNode("div", _hoisted_6$10, [createBaseVNode("label", _hoisted_7$10, [
|
|
819
857
|
_cache[14] || (_cache[14] = createBaseVNode("i", { class: "bi bi-tag me-2" }, null, -1)),
|
|
820
858
|
createTextVNode(toDisplayString(_ctx.$t("connection.connectionName")) + " ", 1),
|
|
821
859
|
_cache[15] || (_cache[15] = createBaseVNode("span", { class: "required" }, "*", -1))
|
|
@@ -825,7 +863,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
825
863
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => connectionForm.value.name = $event),
|
|
826
864
|
placeholder: _ctx.$t("connection.connectionNamePlaceholder"),
|
|
827
865
|
required: ""
|
|
828
|
-
}, null, 8, _hoisted_8$
|
|
866
|
+
}, null, 8, _hoisted_8$10), [[vModelText, connectionForm.value.name]])]), createBaseVNode("div", _hoisted_9$10, [createBaseVNode("label", _hoisted_10$10, [
|
|
829
867
|
_cache[16] || (_cache[16] = createBaseVNode("i", { class: "bi bi-diagram-3 me-2" }, null, -1)),
|
|
830
868
|
createTextVNode(toDisplayString(_ctx.$t("connection.databaseType")) + " ", 1),
|
|
831
869
|
_cache[17] || (_cache[17] = createBaseVNode("span", { class: "required" }, "*", -1))
|
|
@@ -834,13 +872,13 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
834
872
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => connectionForm.value.type = $event),
|
|
835
873
|
onChange: onTypeChange,
|
|
836
874
|
required: ""
|
|
837
|
-
}, [createBaseVNode("option", _hoisted_11$
|
|
875
|
+
}, [createBaseVNode("option", _hoisted_11$10, toDisplayString(_ctx.$t("connection.selectDatabaseType")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(databaseTypes.value, (dbType) => {
|
|
838
876
|
return openBlock(), createElementBlock("option", {
|
|
839
877
|
key: dbType.value,
|
|
840
878
|
value: dbType.value
|
|
841
|
-
}, toDisplayString(dbType.label), 9, _hoisted_12$
|
|
879
|
+
}, toDisplayString(dbType.label), 9, _hoisted_12$10);
|
|
842
880
|
}), 128))], 544), [[vModelSelect, connectionForm.value.type]])])])])]),
|
|
843
|
-
connectionForm.value.type !== "sqlite" && connectionForm.value.type !== "remote" ? (openBlock(), createElementBlock("div", _hoisted_13$
|
|
881
|
+
connectionForm.value.type !== "sqlite" && connectionForm.value.type !== "remote" ? (openBlock(), createElementBlock("div", _hoisted_13$10, [createBaseVNode("div", _hoisted_14$10, [_cache[18] || (_cache[18] = createBaseVNode("div", { class: "section-icon" }, [createBaseVNode("i", { class: "bi bi-hdd-network" })], -1)), createBaseVNode("h3", _hoisted_15$10, toDisplayString(_ctx.$t("connection.connectionConfig")), 1)]), createBaseVNode("div", _hoisted_16$10, [createBaseVNode("div", _hoisted_17$10, [
|
|
844
882
|
createBaseVNode("div", _hoisted_18$9, [createBaseVNode("label", _hoisted_19$9, [
|
|
845
883
|
_cache[19] || (_cache[19] = createBaseVNode("i", { class: "bi bi-server me-2" }, null, -1)),
|
|
846
884
|
createTextVNode(toDisplayString(_ctx.$t("connection.host")) + " ", 1),
|
|
@@ -894,7 +932,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
894
932
|
{ number: true }
|
|
895
933
|
]])])
|
|
896
934
|
])])])) : createCommentVNode("", true),
|
|
897
|
-
connectionForm.value.type === "sqlite" ? (openBlock(), createElementBlock("div", _hoisted_30$
|
|
935
|
+
connectionForm.value.type === "sqlite" ? (openBlock(), createElementBlock("div", _hoisted_30$7, [createBaseVNode("div", _hoisted_31$7, [_cache[26] || (_cache[26] = createBaseVNode("div", { class: "section-icon" }, [createBaseVNode("i", { class: "bi bi-file-earmark-text" })], -1)), createBaseVNode("h3", _hoisted_32$7, toDisplayString(_ctx.$t("connection.sqliteConfig")), 1)]), createBaseVNode("div", _hoisted_33$7, [createBaseVNode("div", _hoisted_34$7, [createBaseVNode("div", _hoisted_35$7, [createBaseVNode("label", _hoisted_36$6, [
|
|
898
936
|
_cache[27] || (_cache[27] = createBaseVNode("i", { class: "bi bi-file-earmark me-2" }, null, -1)),
|
|
899
937
|
createTextVNode(toDisplayString(_ctx.$t("connection.databaseFile")) + " ", 1),
|
|
900
938
|
_cache[28] || (_cache[28] = createBaseVNode("span", { class: "required" }, "*", -1))
|
|
@@ -915,7 +953,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
915
953
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => connectionForm.value.options.remoteUrl = $event),
|
|
916
954
|
placeholder: _ctx.$t("connection.remoteUrlPlaceholder"),
|
|
917
955
|
required: ""
|
|
918
|
-
}, null, 8, _hoisted_45$6), [[vModelText, connectionForm.value.options.remoteUrl]])]), createBaseVNode("div", _hoisted_46$6, [createBaseVNode("label", _hoisted_47$
|
|
956
|
+
}, null, 8, _hoisted_45$6), [[vModelText, connectionForm.value.options.remoteUrl]])]), createBaseVNode("div", _hoisted_46$6, [createBaseVNode("label", _hoisted_47$6, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-key me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("connection.remoteToken")), 1)]), withDirectives(createBaseVNode("input", {
|
|
919
957
|
type: "password",
|
|
920
958
|
class: "form-control-modern",
|
|
921
959
|
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => connectionForm.value.options.remoteToken = $event),
|
|
@@ -926,7 +964,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
926
964
|
class: "form-control-modern",
|
|
927
965
|
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => connectionForm.value.username = $event),
|
|
928
966
|
placeholder: _ctx.$t("connection.usernamePlaceholder")
|
|
929
|
-
}, null, 8, _hoisted_57$
|
|
967
|
+
}, null, 8, _hoisted_57$5), [[vModelText, connectionForm.value.username]])]), createBaseVNode("div", _hoisted_58$4, [createBaseVNode("label", _hoisted_59$4, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-key me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("connection.password")), 1)]), withDirectives(createBaseVNode("input", {
|
|
930
968
|
type: "password",
|
|
931
969
|
class: "form-control-modern",
|
|
932
970
|
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => connectionForm.value.password = $event),
|
|
@@ -959,7 +997,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
959
997
|
margin: "auto"
|
|
960
998
|
}
|
|
961
999
|
}, {
|
|
962
|
-
default: withCtx(() => [createBaseVNode("div", _hoisted_72$
|
|
1000
|
+
default: withCtx(() => [createBaseVNode("div", _hoisted_72$4, [_cache[42] || (_cache[42] = createBaseVNode("div", { class: "error-icon" }, [createBaseVNode("i", { class: "bi bi-exclamation-triangle" })], -1)), createBaseVNode("div", _hoisted_73$4, toDisplayString(errorMessage.value), 1)])]),
|
|
963
1001
|
_: 1
|
|
964
1002
|
}, 8, ["title", "closeButton"])], 64);
|
|
965
1003
|
};
|
|
@@ -53283,7 +53321,7 @@ var init_cm_clipboard = __esmMin((() => {
|
|
|
53283
53321
|
}));
|
|
53284
53322
|
//#endregion
|
|
53285
53323
|
//#region src/platform/database/components/sql-executor.vue?vue&type=script&setup=true&lang.ts
|
|
53286
|
-
var _hoisted_1$
|
|
53324
|
+
var _hoisted_1$9, _hoisted_2$9, _hoisted_3$9, _hoisted_4$9, _hoisted_5$9, _hoisted_6$9, _hoisted_7$9, _hoisted_8$9, _hoisted_9$9, _hoisted_10$9, _hoisted_11$9, _hoisted_12$9, _hoisted_13$9, _hoisted_14$9, _hoisted_15$9, _hoisted_16$9, _hoisted_17$9, _hoisted_18$8, _hoisted_19$8, sql_executor_vue_vue_type_script_setup_true_lang_default;
|
|
53287
53325
|
var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
53288
53326
|
init_vue_runtime_esm_bundler();
|
|
53289
53327
|
init_dist$11();
|
|
@@ -53299,38 +53337,38 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
53299
53337
|
init_export();
|
|
53300
53338
|
init_theme();
|
|
53301
53339
|
init_cm_clipboard();
|
|
53302
|
-
_hoisted_1$
|
|
53303
|
-
_hoisted_2$
|
|
53304
|
-
_hoisted_3$
|
|
53305
|
-
_hoisted_4$
|
|
53306
|
-
_hoisted_5$
|
|
53307
|
-
_hoisted_6$
|
|
53308
|
-
_hoisted_7$
|
|
53309
|
-
_hoisted_8$
|
|
53310
|
-
_hoisted_9$
|
|
53311
|
-
_hoisted_10$
|
|
53312
|
-
_hoisted_11$
|
|
53340
|
+
_hoisted_1$9 = { class: "sql-executor" };
|
|
53341
|
+
_hoisted_2$9 = { class: "sql-toolbar" };
|
|
53342
|
+
_hoisted_3$9 = { class: "toolbar-left" };
|
|
53343
|
+
_hoisted_4$9 = ["disabled"];
|
|
53344
|
+
_hoisted_5$9 = { class: "toolbar-right" };
|
|
53345
|
+
_hoisted_6$9 = { class: "sql-editor" };
|
|
53346
|
+
_hoisted_7$9 = { class: "sql-result" };
|
|
53347
|
+
_hoisted_8$9 = { class: "result-content" };
|
|
53348
|
+
_hoisted_9$9 = { class: "result-header" };
|
|
53349
|
+
_hoisted_10$9 = { class: "result-title" };
|
|
53350
|
+
_hoisted_11$9 = {
|
|
53313
53351
|
key: 0,
|
|
53314
53352
|
class: "sql-loading"
|
|
53315
53353
|
};
|
|
53316
|
-
_hoisted_12$
|
|
53354
|
+
_hoisted_12$9 = {
|
|
53317
53355
|
key: 0,
|
|
53318
53356
|
class: "bi bi-check-circle-fill text-success"
|
|
53319
53357
|
};
|
|
53320
|
-
_hoisted_13$
|
|
53358
|
+
_hoisted_13$9 = {
|
|
53321
53359
|
key: 1,
|
|
53322
53360
|
class: "bi bi-x-circle-fill text-danger"
|
|
53323
53361
|
};
|
|
53324
|
-
_hoisted_14$
|
|
53362
|
+
_hoisted_14$9 = {
|
|
53325
53363
|
key: 0,
|
|
53326
53364
|
class: "result-actions"
|
|
53327
53365
|
};
|
|
53328
|
-
_hoisted_15$
|
|
53366
|
+
_hoisted_15$9 = {
|
|
53329
53367
|
key: 0,
|
|
53330
53368
|
class: "sql-loading-state"
|
|
53331
53369
|
};
|
|
53332
|
-
_hoisted_16$
|
|
53333
|
-
_hoisted_17$
|
|
53370
|
+
_hoisted_16$9 = { class: "d-flex align-items-center justify-content-center py-4" };
|
|
53371
|
+
_hoisted_17$9 = { class: "fw-bold" };
|
|
53334
53372
|
_hoisted_18$8 = { class: "text-muted small" };
|
|
53335
53373
|
_hoisted_19$8 = { class: "json-result" };
|
|
53336
53374
|
sql_executor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -53622,14 +53660,14 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
53622
53660
|
if (sqlResult.value && resultEditor.value) updateResultEditor();
|
|
53623
53661
|
});
|
|
53624
53662
|
return (_ctx, _cache) => {
|
|
53625
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
53663
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [createBaseVNode("div", _hoisted_2$9, [createBaseVNode("div", _hoisted_3$9, [createBaseVNode("button", {
|
|
53626
53664
|
class: "btn btn-primary btn-sm",
|
|
53627
53665
|
onClick: executeSql,
|
|
53628
53666
|
disabled: loading.value
|
|
53629
|
-
}, [_cache[1] || (_cache[1] = createBaseVNode("i", { class: "bi bi-play-fill" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("sqlExecutor.executeSQL")), 1)], 8, _hoisted_4$
|
|
53667
|
+
}, [_cache[1] || (_cache[1] = createBaseVNode("i", { class: "bi bi-play-fill" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("sqlExecutor.executeSQL")), 1)], 8, _hoisted_4$9), createBaseVNode("button", {
|
|
53630
53668
|
class: "btn btn-outline-secondary btn-sm",
|
|
53631
53669
|
onClick: formatSql
|
|
53632
|
-
}, [_cache[2] || (_cache[2] = createBaseVNode("i", { class: "bi bi-braces" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.format")), 1)])]), createBaseVNode("div", _hoisted_5$
|
|
53670
|
+
}, [_cache[2] || (_cache[2] = createBaseVNode("i", { class: "bi bi-braces" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.format")), 1)])]), createBaseVNode("div", _hoisted_5$9, [createBaseVNode("button", {
|
|
53633
53671
|
class: "btn btn-outline-secondary btn-sm",
|
|
53634
53672
|
onClick: clearSql
|
|
53635
53673
|
}, [_cache[3] || (_cache[3] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("sqlExecutor.clearBtn")), 1)])])]), createBaseVNode("div", {
|
|
@@ -53637,7 +53675,7 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
53637
53675
|
ref_key: "containerRef",
|
|
53638
53676
|
ref: containerRef
|
|
53639
53677
|
}, [
|
|
53640
|
-
createBaseVNode("div", _hoisted_6$
|
|
53678
|
+
createBaseVNode("div", _hoisted_6$9, [createBaseVNode("div", {
|
|
53641
53679
|
ref_key: "editorRef",
|
|
53642
53680
|
ref: editorRef,
|
|
53643
53681
|
class: "codemirror-editor"
|
|
@@ -53646,15 +53684,15 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
53646
53684
|
class: normalizeClass(["resizer", { "resizing": isResizing.value }]),
|
|
53647
53685
|
onMousedown: startResize
|
|
53648
53686
|
}, null, 34),
|
|
53649
|
-
createBaseVNode("div", _hoisted_7$
|
|
53650
|
-
createBaseVNode("div", _hoisted_9$
|
|
53687
|
+
createBaseVNode("div", _hoisted_7$9, [createBaseVNode("div", _hoisted_8$9, [
|
|
53688
|
+
createBaseVNode("div", _hoisted_9$9, [createBaseVNode("h6", _hoisted_10$9, [loading.value ? (openBlock(), createElementBlock("div", _hoisted_11$9, [_cache[4] || (_cache[4] = createBaseVNode("div", { class: "spinner-border spinner-border-sm me-2" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("sqlExecutor.executing")), 1)])) : sqlResult.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [sqlResult.value.success ? (openBlock(), createElementBlock("i", _hoisted_12$9)) : (openBlock(), createElementBlock("i", _hoisted_13$9)), createTextVNode(" " + toDisplayString(_ctx.$t("sqlExecutor.resultTitle")), 1)], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(_ctx.$t("sqlExecutor.resultTitle")), 1)], 64))]), sqlResult.value && !loading.value ? (openBlock(), createElementBlock("div", _hoisted_14$9, [createBaseVNode("button", {
|
|
53651
53689
|
class: "btn btn-sm btn-outline-secondary me-2",
|
|
53652
53690
|
onClick: formatJsonResult
|
|
53653
53691
|
}, [_cache[5] || (_cache[5] = createBaseVNode("i", { class: "bi bi-braces" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.format")), 1)]), createBaseVNode("button", {
|
|
53654
53692
|
class: "btn btn-sm btn-outline-secondary",
|
|
53655
53693
|
onClick: _cache[0] || (_cache[0] = ($event) => exportResult("json"))
|
|
53656
53694
|
}, [_cache[6] || (_cache[6] = createBaseVNode("i", { class: "bi bi-file-earmark-code" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("sqlExecutor.exportJSON")), 1)])])) : createCommentVNode("", true)]),
|
|
53657
|
-
loading.value ? (openBlock(), createElementBlock("div", _hoisted_15$
|
|
53695
|
+
loading.value ? (openBlock(), createElementBlock("div", _hoisted_15$9, [createBaseVNode("div", _hoisted_16$9, [_cache[7] || (_cache[7] = createBaseVNode("div", { class: "spinner-border text-primary me-3" }, null, -1)), createBaseVNode("div", null, [createBaseVNode("div", _hoisted_17$9, toDisplayString(_ctx.$t("sqlExecutor.executingSQL")), 1), createBaseVNode("div", _hoisted_18$8, toDisplayString(_ctx.$t("sqlExecutor.executingHint")), 1)])])])) : createCommentVNode("", true),
|
|
53658
53696
|
createBaseVNode("div", _hoisted_19$8, [createBaseVNode("div", {
|
|
53659
53697
|
ref_key: "resultEditorRef",
|
|
53660
53698
|
ref: resultEditorRef,
|
|
@@ -53750,7 +53788,7 @@ var init_download = __esmMin((() => {
|
|
|
53750
53788
|
}));
|
|
53751
53789
|
//#endregion
|
|
53752
53790
|
//#region src/platform/database/components/connection-detail.vue?vue&type=script&setup=true&lang.ts
|
|
53753
|
-
var _hoisted_1$
|
|
53791
|
+
var _hoisted_1$8, _hoisted_2$8, _hoisted_3$8, _hoisted_4$8, _hoisted_5$8, _hoisted_6$8, _hoisted_7$8, _hoisted_8$8, _hoisted_9$8, _hoisted_10$8, _hoisted_11$8, _hoisted_12$8, _hoisted_13$8, _hoisted_14$8, _hoisted_15$8, _hoisted_16$8, _hoisted_17$8, _hoisted_18$7, _hoisted_19$7, _hoisted_20$7, _hoisted_21$7, _hoisted_22$7, _hoisted_23$7, _hoisted_24$7, _hoisted_25$7, _hoisted_26$6, _hoisted_27$6, _hoisted_28$6, _hoisted_29$6, _hoisted_30$6, _hoisted_31$6, _hoisted_32$6, _hoisted_33$6, _hoisted_34$6, _hoisted_35$6, _hoisted_36$5, _hoisted_37$5, _hoisted_38$5, _hoisted_39$5, _hoisted_40$5, _hoisted_41$5, _hoisted_42$5, _hoisted_43$5, _hoisted_44$5, _hoisted_45$5, _hoisted_46$5, _hoisted_47$5, _hoisted_48$4, _hoisted_49$4, _hoisted_50$4, _hoisted_51$4, _hoisted_52$4, _hoisted_53$4, _hoisted_54$4, _hoisted_55$4, _hoisted_56$4, _hoisted_57$4, _hoisted_58$3, _hoisted_59$3, _hoisted_60$3, _hoisted_61$3, _hoisted_62$3, _hoisted_63$3, _hoisted_64$3, _hoisted_65$3, _hoisted_66$3, _hoisted_67$3, _hoisted_68$3, _hoisted_69$3, _hoisted_70$3, _hoisted_71$3, _hoisted_72$3, _hoisted_73$3, _hoisted_74$3, _hoisted_75$3, _hoisted_76$3, _hoisted_77$3, _hoisted_78$3, _hoisted_79$3, _hoisted_80$3, _hoisted_81$3, _hoisted_82$3, _hoisted_83$3, _hoisted_84$2, _hoisted_85$2, _hoisted_86$2, _hoisted_87$2, _hoisted_88$2, _hoisted_89$2, _hoisted_90$2, _hoisted_91$2, _hoisted_92$2, _hoisted_93$2, _hoisted_94$2, _hoisted_95$2, _hoisted_96$2, _hoisted_97$2, _hoisted_98$2, _hoisted_99$2, _hoisted_100$2, _hoisted_101$2, _hoisted_102$2, _hoisted_103$2, _hoisted_104$2, _hoisted_105$2, _hoisted_106$2, _hoisted_107$2, _hoisted_108$2, _hoisted_109$1, _hoisted_110$1, _hoisted_111$1, _hoisted_112$1, _hoisted_113$1, _hoisted_114$1, _hoisted_115$1, _hoisted_116$1, _hoisted_117$1, _hoisted_118$1, _hoisted_119$1, _hoisted_120$1, _hoisted_121$1, _hoisted_122$1, _hoisted_123$1, _hoisted_124$1, _hoisted_125$1, _hoisted_126$1, _hoisted_127$1, _hoisted_128$1, _hoisted_129$1, _hoisted_130, _hoisted_131, _hoisted_132, _hoisted_133, _hoisted_134, _hoisted_135, connection_detail_vue_vue_type_script_setup_true_lang_default;
|
|
53754
53792
|
var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
53755
53793
|
init_vue_runtime_esm_bundler();
|
|
53756
53794
|
init_vue_router();
|
|
@@ -53758,28 +53796,29 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
53758
53796
|
init_sql_executor();
|
|
53759
53797
|
init_vue_i18n();
|
|
53760
53798
|
init_modal();
|
|
53799
|
+
init_toast();
|
|
53761
53800
|
init_database();
|
|
53762
53801
|
init_download();
|
|
53763
|
-
_hoisted_1$
|
|
53764
|
-
_hoisted_2$
|
|
53765
|
-
_hoisted_3$
|
|
53766
|
-
_hoisted_4$
|
|
53767
|
-
_hoisted_5$
|
|
53768
|
-
_hoisted_6$
|
|
53769
|
-
_hoisted_7$
|
|
53770
|
-
_hoisted_8$
|
|
53771
|
-
_hoisted_9$
|
|
53772
|
-
_hoisted_10$
|
|
53773
|
-
_hoisted_11$
|
|
53802
|
+
_hoisted_1$8 = { class: "connection-detail" };
|
|
53803
|
+
_hoisted_2$8 = { class: "connection-header" };
|
|
53804
|
+
_hoisted_3$8 = { class: "connection-info" };
|
|
53805
|
+
_hoisted_4$8 = { class: "connection-avatar" };
|
|
53806
|
+
_hoisted_5$8 = { class: "connection-meta" };
|
|
53807
|
+
_hoisted_6$8 = { class: "connection-name" };
|
|
53808
|
+
_hoisted_7$8 = { class: "connection-type-info" };
|
|
53809
|
+
_hoisted_8$8 = { class: "db-type" };
|
|
53810
|
+
_hoisted_9$8 = { class: "connection-actions" };
|
|
53811
|
+
_hoisted_10$8 = ["title"];
|
|
53812
|
+
_hoisted_11$8 = {
|
|
53774
53813
|
key: 0,
|
|
53775
53814
|
class: "connection-details-panel"
|
|
53776
53815
|
};
|
|
53777
|
-
_hoisted_12$
|
|
53778
|
-
_hoisted_13$
|
|
53779
|
-
_hoisted_14$
|
|
53780
|
-
_hoisted_15$
|
|
53781
|
-
_hoisted_16$
|
|
53782
|
-
_hoisted_17$
|
|
53816
|
+
_hoisted_12$8 = { class: "detail-card" };
|
|
53817
|
+
_hoisted_13$8 = { class: "card-body" };
|
|
53818
|
+
_hoisted_14$8 = { class: "row" };
|
|
53819
|
+
_hoisted_15$8 = { class: "col-md-6" };
|
|
53820
|
+
_hoisted_16$8 = { class: "section-title" };
|
|
53821
|
+
_hoisted_17$8 = { class: "info-grid" };
|
|
53783
53822
|
_hoisted_18$7 = { class: "info-item" };
|
|
53784
53823
|
_hoisted_19$7 = { class: "info-label" };
|
|
53785
53824
|
_hoisted_20$7 = { class: "info-value" };
|
|
@@ -53801,12 +53840,12 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
53801
53840
|
_hoisted_27$6 = { class: "info-item" };
|
|
53802
53841
|
_hoisted_28$6 = { class: "info-label" };
|
|
53803
53842
|
_hoisted_29$6 = { class: "info-value" };
|
|
53804
|
-
_hoisted_30$
|
|
53805
|
-
_hoisted_31$
|
|
53806
|
-
_hoisted_32$
|
|
53807
|
-
_hoisted_33$
|
|
53808
|
-
_hoisted_34$
|
|
53809
|
-
_hoisted_35$
|
|
53843
|
+
_hoisted_30$6 = { class: "info-item" };
|
|
53844
|
+
_hoisted_31$6 = { class: "info-label" };
|
|
53845
|
+
_hoisted_32$6 = { class: "info-value" };
|
|
53846
|
+
_hoisted_33$6 = { class: "info-item" };
|
|
53847
|
+
_hoisted_34$6 = { class: "info-label" };
|
|
53848
|
+
_hoisted_35$6 = { class: "info-value" };
|
|
53810
53849
|
_hoisted_36$5 = { class: "col-md-6" };
|
|
53811
53850
|
_hoisted_37$5 = { class: "section-title" };
|
|
53812
53851
|
_hoisted_38$5 = { class: "stats-grid" };
|
|
@@ -53818,7 +53857,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
53818
53857
|
_hoisted_44$5 = { class: "stat-label" };
|
|
53819
53858
|
_hoisted_45$5 = { class: "stat-item" };
|
|
53820
53859
|
_hoisted_46$5 = { class: "stat-value" };
|
|
53821
|
-
_hoisted_47$
|
|
53860
|
+
_hoisted_47$5 = { class: "stat-label" };
|
|
53822
53861
|
_hoisted_48$4 = { class: "stat-item" };
|
|
53823
53862
|
_hoisted_49$4 = { class: "stat-value" };
|
|
53824
53863
|
_hoisted_50$4 = { class: "stat-label" };
|
|
@@ -53828,7 +53867,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
53828
53867
|
_hoisted_54$4 = { class: "actions-grid" };
|
|
53829
53868
|
_hoisted_55$4 = { class: "action-text" };
|
|
53830
53869
|
_hoisted_56$4 = ["disabled"];
|
|
53831
|
-
_hoisted_57$
|
|
53870
|
+
_hoisted_57$4 = { class: "action-icon" };
|
|
53832
53871
|
_hoisted_58$3 = {
|
|
53833
53872
|
key: 0,
|
|
53834
53873
|
class: "spinner-border spinner-border-sm"
|
|
@@ -53849,33 +53888,33 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
53849
53888
|
_hoisted_69$3 = { class: "databases-section" };
|
|
53850
53889
|
_hoisted_70$3 = { class: "section-header" };
|
|
53851
53890
|
_hoisted_71$3 = { class: "db-search" };
|
|
53852
|
-
_hoisted_72$
|
|
53853
|
-
_hoisted_73$
|
|
53854
|
-
_hoisted_74$
|
|
53891
|
+
_hoisted_72$3 = ["placeholder"];
|
|
53892
|
+
_hoisted_73$3 = ["disabled", "title"];
|
|
53893
|
+
_hoisted_74$3 = {
|
|
53855
53894
|
key: 0,
|
|
53856
53895
|
class: "spinner-border spinner-border-sm"
|
|
53857
53896
|
};
|
|
53858
|
-
_hoisted_75$
|
|
53897
|
+
_hoisted_75$3 = {
|
|
53859
53898
|
key: 1,
|
|
53860
53899
|
class: "bi bi-arrow-clockwise"
|
|
53861
53900
|
};
|
|
53862
|
-
_hoisted_76$
|
|
53863
|
-
_hoisted_77$
|
|
53901
|
+
_hoisted_76$3 = { class: "databases-list" };
|
|
53902
|
+
_hoisted_77$3 = {
|
|
53864
53903
|
key: 0,
|
|
53865
53904
|
class: "loading-state"
|
|
53866
53905
|
};
|
|
53867
|
-
_hoisted_78$
|
|
53906
|
+
_hoisted_78$3 = {
|
|
53868
53907
|
key: 1,
|
|
53869
53908
|
class: "empty-state"
|
|
53870
53909
|
};
|
|
53871
|
-
_hoisted_79$
|
|
53910
|
+
_hoisted_79$3 = {
|
|
53872
53911
|
key: 2,
|
|
53873
53912
|
class: "databases-list-simple"
|
|
53874
53913
|
};
|
|
53875
|
-
_hoisted_80$
|
|
53876
|
-
_hoisted_81$
|
|
53877
|
-
_hoisted_82$
|
|
53878
|
-
_hoisted_83$
|
|
53914
|
+
_hoisted_80$3 = ["onClick"];
|
|
53915
|
+
_hoisted_81$3 = { class: "database-item-name" };
|
|
53916
|
+
_hoisted_82$3 = { class: "database-item-actions" };
|
|
53917
|
+
_hoisted_83$3 = { class: "tab-panel" };
|
|
53879
53918
|
_hoisted_84$2 = { class: "sql-section" };
|
|
53880
53919
|
_hoisted_85$2 = { class: "sql-header" };
|
|
53881
53920
|
_hoisted_86$2 = { class: "sql-title" };
|
|
@@ -53919,36 +53958,38 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
53919
53958
|
_hoisted_117$1 = ["placeholder"];
|
|
53920
53959
|
_hoisted_118$1 = { key: 2 };
|
|
53921
53960
|
_hoisted_119$1 = { class: "mb-3" };
|
|
53922
|
-
_hoisted_120$1 = { class: "
|
|
53923
|
-
_hoisted_121$1 = ["
|
|
53924
|
-
_hoisted_122$1 = {
|
|
53961
|
+
_hoisted_120$1 = { class: "form-label" };
|
|
53962
|
+
_hoisted_121$1 = ["placeholder"];
|
|
53963
|
+
_hoisted_122$1 = { class: "modal-footer" };
|
|
53964
|
+
_hoisted_123$1 = ["disabled"];
|
|
53965
|
+
_hoisted_124$1 = {
|
|
53925
53966
|
key: 0,
|
|
53926
53967
|
class: "spinner-border spinner-border-sm me-2"
|
|
53927
53968
|
};
|
|
53928
|
-
|
|
53969
|
+
_hoisted_125$1 = {
|
|
53929
53970
|
key: 2,
|
|
53930
53971
|
class: "modal fade show d-block",
|
|
53931
53972
|
style: { "background": "rgba(0,0,0,0.5)" }
|
|
53932
53973
|
};
|
|
53933
|
-
|
|
53934
|
-
|
|
53935
|
-
|
|
53936
|
-
|
|
53937
|
-
|
|
53938
|
-
|
|
53974
|
+
_hoisted_126$1 = { class: "modal-dialog modal-lg" };
|
|
53975
|
+
_hoisted_127$1 = { class: "modal-content" };
|
|
53976
|
+
_hoisted_128$1 = { class: "modal-header" };
|
|
53977
|
+
_hoisted_129$1 = { class: "modal-title" };
|
|
53978
|
+
_hoisted_130 = { class: "modal-body" };
|
|
53979
|
+
_hoisted_131 = {
|
|
53939
53980
|
key: 0,
|
|
53940
53981
|
class: "logs-state"
|
|
53941
53982
|
};
|
|
53942
|
-
|
|
53983
|
+
_hoisted_132 = {
|
|
53943
53984
|
key: 1,
|
|
53944
53985
|
class: "logs-state"
|
|
53945
53986
|
};
|
|
53946
|
-
|
|
53987
|
+
_hoisted_133 = {
|
|
53947
53988
|
key: 2,
|
|
53948
53989
|
class: "logs-table-wrap"
|
|
53949
53990
|
};
|
|
53950
|
-
|
|
53951
|
-
|
|
53991
|
+
_hoisted_134 = { class: "table table-sm table-bordered mb-0" };
|
|
53992
|
+
_hoisted_135 = { class: "modal-footer" };
|
|
53952
53993
|
connection_detail_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
53953
53994
|
__name: "connection-detail",
|
|
53954
53995
|
props: { connection: {} },
|
|
@@ -54154,7 +54195,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54154
54195
|
creatingDatabase.value = true;
|
|
54155
54196
|
try {
|
|
54156
54197
|
await connectionStore.createDatabase(newDatabase.value.name);
|
|
54157
|
-
|
|
54198
|
+
toast.success(t("connection.databaseCreateSuccess"));
|
|
54158
54199
|
showCreateDatabase.value = false;
|
|
54159
54200
|
newDatabase.value = {
|
|
54160
54201
|
name: "",
|
|
@@ -54196,7 +54237,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54196
54237
|
mssql: "SQL Server",
|
|
54197
54238
|
sqlite: "SQLite",
|
|
54198
54239
|
oracle: "Oracle",
|
|
54199
|
-
remote: "
|
|
54240
|
+
remote: t("connection.typeRemote")
|
|
54200
54241
|
}[type || ""] || "Unknown";
|
|
54201
54242
|
}
|
|
54202
54243
|
function getDbLogoClass(type) {
|
|
@@ -54213,13 +54254,13 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54213
54254
|
}[type || ""] || "DB";
|
|
54214
54255
|
}
|
|
54215
54256
|
return (_ctx, _cache) => {
|
|
54216
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
54217
|
-
createBaseVNode("div", _hoisted_2$
|
|
54257
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
54258
|
+
createBaseVNode("div", _hoisted_2$8, [createBaseVNode("div", _hoisted_3$8, [createBaseVNode("div", _hoisted_4$8, [createBaseVNode("div", { class: normalizeClass(["db-logo", getDbLogoClass(__props.connection?.type)]) }, toDisplayString(getDbLogoText(__props.connection?.type)), 3)]), createBaseVNode("div", _hoisted_5$8, [createBaseVNode("h4", _hoisted_6$8, toDisplayString(__props.connection?.name), 1), createBaseVNode("div", _hoisted_7$8, [createBaseVNode("span", _hoisted_8$8, toDisplayString(getDbTypeLabel(__props.connection?.type)), 1), createBaseVNode("span", { class: normalizeClass(["connection-status", connectionStatusClass.value]) }, [_cache[16] || (_cache[16] = createBaseVNode("div", { class: "status-dot" }, null, -1)), createTextVNode(" " + toDisplayString(connectionStatusText.value), 1)], 2)])])]), createBaseVNode("div", _hoisted_9$8, [
|
|
54218
54259
|
createBaseVNode("button", {
|
|
54219
54260
|
class: "btn btn-sm btn-outline-info",
|
|
54220
54261
|
onClick: toggleDetails,
|
|
54221
54262
|
title: _ctx.$t("connection.toggleDetails")
|
|
54222
|
-
}, [createBaseVNode("i", { class: normalizeClass(["bi", isDetailsExpanded.value ? "bi-chevron-up" : "bi-chevron-down"]) }, null, 2), createTextVNode(" " + toDisplayString(_ctx.$t("connection.details")), 1)], 8, _hoisted_10$
|
|
54263
|
+
}, [createBaseVNode("i", { class: normalizeClass(["bi", isDetailsExpanded.value ? "bi-chevron-up" : "bi-chevron-down"]) }, null, 2), createTextVNode(" " + toDisplayString(_ctx.$t("connection.details")), 1)], 8, _hoisted_10$8),
|
|
54223
54264
|
createBaseVNode("button", {
|
|
54224
54265
|
class: "btn btn-sm btn-outline-primary",
|
|
54225
54266
|
onClick: testConnection
|
|
@@ -54229,17 +54270,17 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54229
54270
|
onClick: editConnection
|
|
54230
54271
|
}, [_cache[18] || (_cache[18] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)])
|
|
54231
54272
|
])]),
|
|
54232
|
-
isDetailsExpanded.value ? (openBlock(), createElementBlock("div", _hoisted_11$
|
|
54273
|
+
isDetailsExpanded.value ? (openBlock(), createElementBlock("div", _hoisted_11$8, [createBaseVNode("div", _hoisted_12$8, [createBaseVNode("div", _hoisted_13$8, [createBaseVNode("div", _hoisted_14$8, [createBaseVNode("div", _hoisted_15$8, [createBaseVNode("h6", _hoisted_16$8, [_cache[19] || (_cache[19] = createBaseVNode("i", { class: "bi bi-info-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("connection.basicInfo")), 1)]), createBaseVNode("div", _hoisted_17$8, [
|
|
54233
54274
|
createBaseVNode("div", _hoisted_18$7, [createBaseVNode("label", _hoisted_19$7, toDisplayString(_ctx.$t("connection.host")), 1), createBaseVNode("div", _hoisted_20$7, toDisplayString(__props.connection?.host), 1)]),
|
|
54234
54275
|
__props.connection?._isProxy && __props.connection?.options?.remoteUrl ? (openBlock(), createElementBlock("div", _hoisted_21$7, [createBaseVNode("label", _hoisted_22$7, toDisplayString(_ctx.$t("connection.remoteUrl")), 1), createBaseVNode("div", _hoisted_23$7, toDisplayString(__props.connection?.options?.remoteUrl), 1)])) : createCommentVNode("", true),
|
|
54235
54276
|
__props.connection?._remoteError ? (openBlock(), createElementBlock("div", _hoisted_24$7, [createBaseVNode("label", _hoisted_25$7, toDisplayString(_ctx.$t("connection.connectionStatus")), 1), createBaseVNode("div", _hoisted_26$6, toDisplayString(__props.connection?._remoteError), 1)])) : createCommentVNode("", true),
|
|
54236
54277
|
createBaseVNode("div", _hoisted_27$6, [createBaseVNode("label", _hoisted_28$6, toDisplayString(_ctx.$t("connection.port")), 1), createBaseVNode("div", _hoisted_29$6, toDisplayString(__props.connection?.port), 1)]),
|
|
54237
|
-
createBaseVNode("div", _hoisted_30$
|
|
54238
|
-
createBaseVNode("div", _hoisted_33$
|
|
54278
|
+
createBaseVNode("div", _hoisted_30$6, [createBaseVNode("label", _hoisted_31$6, toDisplayString(_ctx.$t("connection.username")), 1), createBaseVNode("div", _hoisted_32$6, toDisplayString(__props.connection?.username), 1)]),
|
|
54279
|
+
createBaseVNode("div", _hoisted_33$6, [createBaseVNode("label", _hoisted_34$6, toDisplayString(_ctx.$t("connection.databaseType")), 1), createBaseVNode("div", _hoisted_35$6, [createBaseVNode("span", { class: normalizeClass(["db-type-badge", getDbLogoClass(__props.connection?.type)]) }, toDisplayString(getDbTypeLabel(__props.connection?.type)), 3)])])
|
|
54239
54280
|
])]), createBaseVNode("div", _hoisted_36$5, [createBaseVNode("h6", _hoisted_37$5, [_cache[20] || (_cache[20] = createBaseVNode("i", { class: "bi bi-bar-chart" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("connection.connectionStats")), 1)]), createBaseVNode("div", _hoisted_38$5, [
|
|
54240
54281
|
createBaseVNode("div", _hoisted_39$5, [createBaseVNode("div", _hoisted_40$5, toDisplayString(connectionStats.value.databaseCount || 0), 1), createBaseVNode("div", _hoisted_41$5, toDisplayString(_ctx.$t("connection.databaseCount")), 1)]),
|
|
54241
54282
|
createBaseVNode("div", _hoisted_42$5, [createBaseVNode("div", _hoisted_43$5, toDisplayString(connectionStats.value.tableCount || 0), 1), createBaseVNode("div", _hoisted_44$5, toDisplayString(_ctx.$t("connection.tableCount")), 1)]),
|
|
54242
|
-
createBaseVNode("div", _hoisted_45$5, [createBaseVNode("div", _hoisted_46$5, toDisplayString(formatFileSize(connectionStats.value.totalSize || 0)), 1), createBaseVNode("div", _hoisted_47$
|
|
54283
|
+
createBaseVNode("div", _hoisted_45$5, [createBaseVNode("div", _hoisted_46$5, toDisplayString(formatFileSize(connectionStats.value.totalSize || 0)), 1), createBaseVNode("div", _hoisted_47$5, toDisplayString(_ctx.$t("connection.totalSize")), 1)]),
|
|
54243
54284
|
createBaseVNode("div", _hoisted_48$4, [createBaseVNode("div", _hoisted_49$4, toDisplayString(connectionStats.value.lastConnected || _ctx.$t("common.never")), 1), createBaseVNode("div", _hoisted_50$4, toDisplayString(_ctx.$t("connection.lastConnected")), 1)])
|
|
54244
54285
|
])])])])])])) : createCommentVNode("", true),
|
|
54245
54286
|
createBaseVNode("div", _hoisted_51$4, [createBaseVNode("div", _hoisted_52$4, [createBaseVNode("h6", _hoisted_53$4, [_cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-lightning" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("connection.quickActions")), 1)])]), createBaseVNode("div", _hoisted_54$4, [
|
|
@@ -54251,7 +54292,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54251
54292
|
class: "action-btn",
|
|
54252
54293
|
disabled: exportingSchema.value,
|
|
54253
54294
|
onClick: exportSchema
|
|
54254
|
-
}, [createBaseVNode("div", _hoisted_57$
|
|
54295
|
+
}, [createBaseVNode("div", _hoisted_57$4, [exportingSchema.value ? (openBlock(), createElementBlock("i", _hoisted_58$3)) : (openBlock(), createElementBlock("i", _hoisted_59$3))]), createBaseVNode("div", _hoisted_60$3, toDisplayString(_ctx.$t("connection.exportSchema")), 1)], 8, _hoisted_56$4),
|
|
54255
54296
|
createBaseVNode("button", {
|
|
54256
54297
|
class: "action-btn",
|
|
54257
54298
|
onClick: viewLogs
|
|
@@ -54272,32 +54313,32 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54272
54313
|
class: "db-search-input",
|
|
54273
54314
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchKeyword.value = $event),
|
|
54274
54315
|
placeholder: _ctx.$t("connection.searchDatabase")
|
|
54275
|
-
}, null, 8, _hoisted_72$
|
|
54316
|
+
}, null, 8, _hoisted_72$3), [[vModelText, searchKeyword.value]])]), createBaseVNode("button", {
|
|
54276
54317
|
class: "db-refresh-btn",
|
|
54277
54318
|
onClick: loadDatabases,
|
|
54278
54319
|
disabled: loadingDatabases.value,
|
|
54279
54320
|
title: _ctx.$t("common.refresh")
|
|
54280
|
-
}, [loadingDatabases.value ? (openBlock(), createElementBlock("span", _hoisted_74$
|
|
54321
|
+
}, [loadingDatabases.value ? (openBlock(), createElementBlock("span", _hoisted_74$3)) : (openBlock(), createElementBlock("i", _hoisted_75$3))], 8, _hoisted_73$3)]), createBaseVNode("div", _hoisted_76$3, [loadingDatabases.value ? (openBlock(), createElementBlock("div", _hoisted_77$3, [_cache[27] || (_cache[27] = createBaseVNode("div", { class: "spinner-border text-primary" }, null, -1)), createBaseVNode("span", null, toDisplayString(_ctx.$t("connection.loadingDatabases")), 1)])) : filteredDatabases.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_78$3, [
|
|
54281
54322
|
_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-database" }, null, -1)),
|
|
54282
54323
|
createBaseVNode("p", null, toDisplayString(searchKeyword.value ? _ctx.$t("connection.noMatchDatabase") : _ctx.$t("connection.noDatabase")), 1),
|
|
54283
54324
|
createBaseVNode("button", {
|
|
54284
54325
|
class: "btn btn-sm btn-primary",
|
|
54285
54326
|
onClick: showCreateDatabaseModal
|
|
54286
54327
|
}, [_cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("connection.createDatabase")), 1)])
|
|
54287
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_79$
|
|
54328
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_79$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredDatabases.value, (database) => {
|
|
54288
54329
|
return openBlock(), createElementBlock("div", {
|
|
54289
54330
|
key: database.name,
|
|
54290
54331
|
class: "database-item",
|
|
54291
54332
|
onClick: ($event) => openDatabase(database)
|
|
54292
54333
|
}, [
|
|
54293
54334
|
_cache[31] || (_cache[31] = createBaseVNode("div", { class: "database-item-icon" }, [createBaseVNode("i", { class: "bi bi-database" })], -1)),
|
|
54294
|
-
createBaseVNode("div", _hoisted_81$
|
|
54295
|
-
createBaseVNode("div", _hoisted_82$
|
|
54335
|
+
createBaseVNode("div", _hoisted_81$3, toDisplayString(database.name), 1),
|
|
54336
|
+
createBaseVNode("div", _hoisted_82$3, [createBaseVNode("button", {
|
|
54296
54337
|
class: "btn btn-sm btn-outline-secondary",
|
|
54297
54338
|
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => activeTab.value = "sql", ["stop"]))
|
|
54298
54339
|
}, [..._cache[30] || (_cache[30] = [createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)])])])
|
|
54299
|
-
], 8, _hoisted_80$
|
|
54300
|
-
}), 128))]))])])], 512), [[vShow, activeTab.value === "databases"]]), withDirectives(createBaseVNode("div", _hoisted_83$
|
|
54340
|
+
], 8, _hoisted_80$3);
|
|
54341
|
+
}), 128))]))])])], 512), [[vShow, activeTab.value === "databases"]]), withDirectives(createBaseVNode("div", _hoisted_83$3, [createBaseVNode("div", _hoisted_84$2, [createBaseVNode("div", _hoisted_85$2, [createBaseVNode("h6", _hoisted_86$2, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("nav.sqlQuery")), 1)]), props.connection ? (openBlock(), createElementBlock("div", _hoisted_87$2, [createBaseVNode("span", _hoisted_88$2, toDisplayString(props.connection.name), 1)])) : createCommentVNode("", true)]), createVNode(sql_executor_default, {
|
|
54301
54342
|
connection: props.connection,
|
|
54302
54343
|
database: ""
|
|
54303
54344
|
}, null, 8, ["connection"])])], 512), [[vShow, activeTab.value === "sql"]])])]),
|
|
@@ -54360,14 +54401,14 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54360
54401
|
placeholder: _ctx.$t("connection.tablespace")
|
|
54361
54402
|
}, null, 8, _hoisted_117$1), [[vModelText, newDatabase.value.options.tablespace]])])
|
|
54362
54403
|
])) : createCommentVNode("", true),
|
|
54363
|
-
__props.connection?.type === "mssql" ? (openBlock(), createElementBlock("div", _hoisted_118$1, [createBaseVNode("div", _hoisted_119$1, [
|
|
54404
|
+
__props.connection?.type === "mssql" ? (openBlock(), createElementBlock("div", _hoisted_118$1, [createBaseVNode("div", _hoisted_119$1, [createBaseVNode("label", _hoisted_120$1, toDisplayString(_ctx.$t("connection.collation")), 1), withDirectives(createBaseVNode("input", {
|
|
54364
54405
|
type: "text",
|
|
54365
54406
|
class: "form-control",
|
|
54366
54407
|
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => newDatabase.value.options.collation = $event),
|
|
54367
|
-
placeholder: "
|
|
54368
|
-
}, null,
|
|
54408
|
+
placeholder: _ctx.$t("connection.collation")
|
|
54409
|
+
}, null, 8, _hoisted_121$1), [[vModelText, newDatabase.value.options.collation]])])])) : createCommentVNode("", true)
|
|
54369
54410
|
])]),
|
|
54370
|
-
createBaseVNode("div",
|
|
54411
|
+
createBaseVNode("div", _hoisted_122$1, [createBaseVNode("button", {
|
|
54371
54412
|
type: "button",
|
|
54372
54413
|
class: "btn btn-secondary",
|
|
54373
54414
|
onClick: _cache[13] || (_cache[13] = ($event) => showCreateDatabase.value = false)
|
|
@@ -54376,22 +54417,22 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54376
54417
|
class: "btn btn-primary",
|
|
54377
54418
|
onClick: createDatabase,
|
|
54378
54419
|
disabled: !newDatabase.value.name || creatingDatabase.value
|
|
54379
|
-
}, [creatingDatabase.value ? (openBlock(), createElementBlock("span",
|
|
54420
|
+
}, [creatingDatabase.value ? (openBlock(), createElementBlock("span", _hoisted_124$1)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(_ctx.$t("common.create")), 1)], 8, _hoisted_123$1)])
|
|
54380
54421
|
])])])) : createCommentVNode("", true),
|
|
54381
|
-
showLogs.value ? (openBlock(), createElementBlock("div",
|
|
54382
|
-
createBaseVNode("div",
|
|
54422
|
+
showLogs.value ? (openBlock(), createElementBlock("div", _hoisted_125$1, [createBaseVNode("div", _hoisted_126$1, [createBaseVNode("div", _hoisted_127$1, [
|
|
54423
|
+
createBaseVNode("div", _hoisted_128$1, [createBaseVNode("h5", _hoisted_129$1, toDisplayString(_ctx.$t("connection.logsTitle")), 1), createBaseVNode("button", {
|
|
54383
54424
|
type: "button",
|
|
54384
54425
|
class: "btn-close",
|
|
54385
54426
|
onClick: _cache[14] || (_cache[14] = ($event) => showLogs.value = false)
|
|
54386
54427
|
})]),
|
|
54387
|
-
createBaseVNode("div",
|
|
54428
|
+
createBaseVNode("div", _hoisted_130, [loadingLogs.value ? (openBlock(), createElementBlock("div", _hoisted_131, [_cache[42] || (_cache[42] = createBaseVNode("span", { class: "spinner-border spinner-border-sm me-2" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.loading")), 1)])) : !connectionLogs.value.length ? (openBlock(), createElementBlock("div", _hoisted_132, toDisplayString(_ctx.$t("connection.logsEmpty")), 1)) : (openBlock(), createElementBlock("div", _hoisted_133, [createBaseVNode("table", _hoisted_134, [createBaseVNode("thead", null, [createBaseVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(logColumns.value, (col) => {
|
|
54388
54429
|
return openBlock(), createElementBlock("th", { key: col }, toDisplayString(col), 1);
|
|
54389
54430
|
}), 128))])]), createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(connectionLogs.value, (row, i) => {
|
|
54390
54431
|
return openBlock(), createElementBlock("tr", { key: i }, [(openBlock(true), createElementBlock(Fragment, null, renderList(logColumns.value, (col) => {
|
|
54391
54432
|
return openBlock(), createElementBlock("td", { key: col }, toDisplayString(formatLogCell(row, col)), 1);
|
|
54392
54433
|
}), 128))]);
|
|
54393
54434
|
}), 128))])])]))]),
|
|
54394
|
-
createBaseVNode("div",
|
|
54435
|
+
createBaseVNode("div", _hoisted_135, [createBaseVNode("button", {
|
|
54395
54436
|
type: "button",
|
|
54396
54437
|
class: "btn btn-secondary",
|
|
54397
54438
|
onClick: _cache[15] || (_cache[15] = ($event) => showLogs.value = false)
|
|
@@ -54403,17 +54444,17 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
|
|
|
54403
54444
|
});
|
|
54404
54445
|
}));
|
|
54405
54446
|
//#endregion
|
|
54406
|
-
//#region src/platform/database/components/connection-detail.vue?vue&type=style&index=0&scoped=
|
|
54407
|
-
var
|
|
54447
|
+
//#region src/platform/database/components/connection-detail.vue?vue&type=style&index=0&scoped=c8b33172&lang.css
|
|
54448
|
+
var init_connection_detail_vue_vue_type_style_index_0_scoped_c8b33172_lang = __esmMin((() => {}));
|
|
54408
54449
|
//#endregion
|
|
54409
54450
|
//#region src/platform/database/components/connection-detail.vue
|
|
54410
54451
|
var connection_detail_default;
|
|
54411
54452
|
var init_connection_detail = __esmMin((() => {
|
|
54412
54453
|
init_connection_detail_vue_vue_type_script_setup_true_lang();
|
|
54413
54454
|
init_connection_detail_vue_vue_type_script_setup_true_lang();
|
|
54414
|
-
|
|
54455
|
+
init_connection_detail_vue_vue_type_style_index_0_scoped_c8b33172_lang();
|
|
54415
54456
|
init__plugin_vue_export_helper();
|
|
54416
|
-
connection_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(connection_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
54457
|
+
connection_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(connection_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-c8b33172"]]);
|
|
54417
54458
|
}));
|
|
54418
54459
|
//#endregion
|
|
54419
54460
|
//#region src/typings/database-types.ts
|
|
@@ -54430,7 +54471,21 @@ function getColumnTypesByName(databaseTypeName) {
|
|
|
54430
54471
|
const type = Object.values(DatabaseType).find((t) => t === databaseTypeName.toLowerCase());
|
|
54431
54472
|
return type ? getColumnTypes(type) : [];
|
|
54432
54473
|
}
|
|
54433
|
-
|
|
54474
|
+
/** 按连接类型判定数据模型 */
|
|
54475
|
+
function getDataModel(type) {
|
|
54476
|
+
return DOCUMENT_DB_TYPES.has(String(type || "").toLowerCase()) ? "document" : "relational";
|
|
54477
|
+
}
|
|
54478
|
+
/** 是否文档型数据库:UI 据此切换到文档模式(集合/文档/JSON),关闭关系型入口 */
|
|
54479
|
+
function isDocumentDb(type) {
|
|
54480
|
+
return getDataModel(type) === "document";
|
|
54481
|
+
}
|
|
54482
|
+
/** 文档模式下的术语:表→集合,记录→文档 */
|
|
54483
|
+
function nounOf(type, key) {
|
|
54484
|
+
const doc = isDocumentDb(type);
|
|
54485
|
+
if (key === "table") return doc ? "集合" : "表";
|
|
54486
|
+
return doc ? "文档" : "记录";
|
|
54487
|
+
}
|
|
54488
|
+
var DatabaseType, ColumnCategory, MYSQL_COLUMN_TYPES, POSTGRESQL_COLUMN_TYPES, SQLITE_COLUMN_TYPES, ORACLE_COLUMN_TYPES, SQLSERVER_COLUMN_TYPES, DATABASE_TYPE_CONFIGS, DOCUMENT_DB_TYPES;
|
|
54434
54489
|
var init_database_types$1 = __esmMin((() => {
|
|
54435
54490
|
DatabaseType = /* @__PURE__ */ function(DatabaseType) {
|
|
54436
54491
|
DatabaseType["MYSQL"] = "mysql";
|
|
@@ -55557,17 +55612,18 @@ var init_database_types$1 = __esmMin((() => {
|
|
|
55557
55612
|
supportedColumnTypes: SQLSERVER_COLUMN_TYPES
|
|
55558
55613
|
}
|
|
55559
55614
|
};
|
|
55615
|
+
DOCUMENT_DB_TYPES = /* @__PURE__ */ new Set(["mongodb", "mongo"]);
|
|
55560
55616
|
}));
|
|
55561
55617
|
//#endregion
|
|
55562
55618
|
//#region src/platform/database/components/table-editor.vue?vue&type=script&setup=true&lang.ts
|
|
55563
|
-
var _hoisted_1$
|
|
55619
|
+
var _hoisted_1$7, _hoisted_2$7, _hoisted_3$7, _hoisted_4$7, _hoisted_5$7, _hoisted_6$7, _hoisted_7$7, _hoisted_8$7, _hoisted_9$7, _hoisted_10$7, _hoisted_11$7, _hoisted_12$7, _hoisted_13$7, _hoisted_14$7, _hoisted_15$7, _hoisted_16$7, _hoisted_17$7, _hoisted_18$6, _hoisted_19$6, _hoisted_20$6, _hoisted_21$6, _hoisted_22$6, _hoisted_23$6, _hoisted_24$6, _hoisted_25$6, _hoisted_26$5, _hoisted_27$5, _hoisted_28$5, _hoisted_29$5, _hoisted_30$5, _hoisted_31$5, _hoisted_32$5, _hoisted_33$5, _hoisted_34$5, _hoisted_35$5, _hoisted_36$4, _hoisted_37$4, _hoisted_38$4, _hoisted_39$4, _hoisted_40$4, _hoisted_41$4, _hoisted_42$4, _hoisted_43$4, _hoisted_44$4, _hoisted_45$4, _hoisted_46$4, _hoisted_47$4, _hoisted_48$3, _hoisted_49$3, _hoisted_50$3, _hoisted_51$3, _hoisted_52$3, _hoisted_53$3, _hoisted_54$3, _hoisted_55$3, _hoisted_56$3, _hoisted_57$3, CUSTOM_TYPE_VALUE, table_editor_vue_vue_type_script_setup_true_lang_default;
|
|
55564
55620
|
var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
55565
55621
|
init_vue_runtime_esm_bundler();
|
|
55566
55622
|
init_vue_i18n();
|
|
55567
55623
|
init_database();
|
|
55568
55624
|
init_modal();
|
|
55569
55625
|
init_database_types$1();
|
|
55570
|
-
_hoisted_1$
|
|
55626
|
+
_hoisted_1$7 = {
|
|
55571
55627
|
key: 0,
|
|
55572
55628
|
class: "modal fade show",
|
|
55573
55629
|
style: {
|
|
@@ -55575,91 +55631,95 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55575
55631
|
"background-color": "rgba(0,0,0,0.5)"
|
|
55576
55632
|
}
|
|
55577
55633
|
};
|
|
55578
|
-
_hoisted_2$
|
|
55579
|
-
_hoisted_3$
|
|
55580
|
-
_hoisted_4$
|
|
55581
|
-
_hoisted_5$
|
|
55582
|
-
_hoisted_6$
|
|
55583
|
-
_hoisted_7$
|
|
55584
|
-
_hoisted_8$
|
|
55585
|
-
_hoisted_9$
|
|
55586
|
-
_hoisted_10$
|
|
55587
|
-
_hoisted_11$
|
|
55588
|
-
_hoisted_12$
|
|
55589
|
-
_hoisted_13$
|
|
55590
|
-
_hoisted_14$
|
|
55591
|
-
_hoisted_15$
|
|
55592
|
-
_hoisted_16$
|
|
55634
|
+
_hoisted_2$7 = { class: "modal-content" };
|
|
55635
|
+
_hoisted_3$7 = { class: "modal-header" };
|
|
55636
|
+
_hoisted_4$7 = { class: "modal-title" };
|
|
55637
|
+
_hoisted_5$7 = { class: "modal-body" };
|
|
55638
|
+
_hoisted_6$7 = { class: "table-info-section mb-4" };
|
|
55639
|
+
_hoisted_7$7 = { class: "section-title" };
|
|
55640
|
+
_hoisted_8$7 = { class: "row" };
|
|
55641
|
+
_hoisted_9$7 = { class: "col-md-6" };
|
|
55642
|
+
_hoisted_10$7 = { class: "mb-3" };
|
|
55643
|
+
_hoisted_11$7 = { class: "form-label" };
|
|
55644
|
+
_hoisted_12$7 = ["disabled", "placeholder"];
|
|
55645
|
+
_hoisted_13$7 = { class: "col-md-6" };
|
|
55646
|
+
_hoisted_14$7 = { class: "mb-3" };
|
|
55647
|
+
_hoisted_15$7 = { class: "form-label" };
|
|
55648
|
+
_hoisted_16$7 = [
|
|
55593
55649
|
"disabled",
|
|
55594
55650
|
"title",
|
|
55595
55651
|
"placeholder"
|
|
55596
55652
|
];
|
|
55597
|
-
_hoisted_17$
|
|
55598
|
-
_hoisted_18$6 = {
|
|
55599
|
-
|
|
55600
|
-
|
|
55601
|
-
|
|
55602
|
-
|
|
55603
|
-
|
|
55604
|
-
|
|
55605
|
-
|
|
55606
|
-
|
|
55607
|
-
|
|
55653
|
+
_hoisted_17$7 = ["innerHTML"];
|
|
55654
|
+
_hoisted_18$6 = {
|
|
55655
|
+
key: 1,
|
|
55656
|
+
class: "columns-section"
|
|
55657
|
+
};
|
|
55658
|
+
_hoisted_19$6 = { class: "section-header d-flex justify-content-between align-items-center mb-3" };
|
|
55659
|
+
_hoisted_20$6 = { class: "section-title mb-0" };
|
|
55660
|
+
_hoisted_21$6 = { class: "table-responsive" };
|
|
55661
|
+
_hoisted_22$6 = { class: "table table-sm table-bordered" };
|
|
55662
|
+
_hoisted_23$6 = { width: "120" };
|
|
55663
|
+
_hoisted_24$6 = { width: "140" };
|
|
55664
|
+
_hoisted_25$6 = { width: "120" };
|
|
55665
|
+
_hoisted_26$5 = { width: "80" };
|
|
55666
|
+
_hoisted_27$5 = { width: "100" };
|
|
55608
55667
|
_hoisted_28$5 = { width: "80" };
|
|
55609
|
-
_hoisted_29$5 = { width: "
|
|
55610
|
-
_hoisted_30$
|
|
55668
|
+
_hoisted_29$5 = { width: "80" };
|
|
55669
|
+
_hoisted_30$5 = { width: "100" };
|
|
55670
|
+
_hoisted_31$5 = [
|
|
55611
55671
|
"onUpdate:modelValue",
|
|
55612
55672
|
"disabled",
|
|
55613
55673
|
"title",
|
|
55614
55674
|
"placeholder"
|
|
55615
55675
|
];
|
|
55616
|
-
|
|
55617
|
-
|
|
55618
|
-
|
|
55619
|
-
|
|
55620
|
-
|
|
55621
|
-
|
|
55676
|
+
_hoisted_32$5 = ["onUpdate:modelValue"];
|
|
55677
|
+
_hoisted_33$5 = { value: "" };
|
|
55678
|
+
_hoisted_34$5 = ["label"];
|
|
55679
|
+
_hoisted_35$5 = ["value"];
|
|
55680
|
+
_hoisted_36$4 = ["onUpdate:modelValue", "placeholder"];
|
|
55681
|
+
_hoisted_37$4 = {
|
|
55622
55682
|
key: 0,
|
|
55623
55683
|
class: "input-group input-group-sm"
|
|
55624
55684
|
};
|
|
55625
|
-
_hoisted_37$4 = ["onUpdate:modelValue", "placeholder"];
|
|
55626
55685
|
_hoisted_38$4 = ["onUpdate:modelValue", "placeholder"];
|
|
55627
55686
|
_hoisted_39$4 = ["onUpdate:modelValue", "placeholder"];
|
|
55628
|
-
_hoisted_40$4 =
|
|
55687
|
+
_hoisted_40$4 = ["onUpdate:modelValue", "placeholder"];
|
|
55688
|
+
_hoisted_41$4 = {
|
|
55629
55689
|
key: 1,
|
|
55630
55690
|
class: "text-muted"
|
|
55631
55691
|
};
|
|
55632
|
-
|
|
55633
|
-
|
|
55634
|
-
|
|
55635
|
-
|
|
55636
|
-
|
|
55692
|
+
_hoisted_42$4 = { class: "form-check" };
|
|
55693
|
+
_hoisted_43$4 = ["onUpdate:modelValue"];
|
|
55694
|
+
_hoisted_44$4 = ["onUpdate:modelValue", "placeholder"];
|
|
55695
|
+
_hoisted_45$4 = { class: "form-check" };
|
|
55696
|
+
_hoisted_46$4 = [
|
|
55637
55697
|
"onUpdate:modelValue",
|
|
55638
55698
|
"disabled",
|
|
55639
55699
|
"title",
|
|
55640
55700
|
"onChange"
|
|
55641
55701
|
];
|
|
55642
|
-
|
|
55643
|
-
|
|
55702
|
+
_hoisted_47$4 = { class: "form-check" };
|
|
55703
|
+
_hoisted_48$3 = [
|
|
55644
55704
|
"onUpdate:modelValue",
|
|
55645
55705
|
"disabled",
|
|
55646
55706
|
"title",
|
|
55647
55707
|
"onChange"
|
|
55648
55708
|
];
|
|
55649
|
-
|
|
55709
|
+
_hoisted_49$3 = [
|
|
55650
55710
|
"onUpdate:modelValue",
|
|
55651
55711
|
"disabled",
|
|
55652
55712
|
"title",
|
|
55653
55713
|
"placeholder"
|
|
55654
55714
|
];
|
|
55655
|
-
|
|
55656
|
-
|
|
55657
|
-
|
|
55658
|
-
|
|
55659
|
-
|
|
55660
|
-
|
|
55661
|
-
|
|
55662
|
-
|
|
55715
|
+
_hoisted_50$3 = ["onClick", "disabled"];
|
|
55716
|
+
_hoisted_51$3 = { class: "sql-preview-section mt-4" };
|
|
55717
|
+
_hoisted_52$3 = { class: "d-flex align-items-center justify-content-between" };
|
|
55718
|
+
_hoisted_53$3 = { class: "section-title mb-0" };
|
|
55719
|
+
_hoisted_54$3 = ["disabled", "title"];
|
|
55720
|
+
_hoisted_55$3 = { class: "sql-preview mt-2" };
|
|
55721
|
+
_hoisted_56$3 = { class: "modal-footer" };
|
|
55722
|
+
_hoisted_57$3 = ["disabled", "title"];
|
|
55663
55723
|
CUSTOM_TYPE_VALUE = "__custom__";
|
|
55664
55724
|
table_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
55665
55725
|
__name: "table-editor",
|
|
@@ -55807,14 +55867,15 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55807
55867
|
}
|
|
55808
55868
|
const previewSql = ref("-- 完善表单后将在此显示后端生成的 SQL");
|
|
55809
55869
|
const caps = ref(null);
|
|
55870
|
+
const schemalessCreate = computed(() => props.mode === "create" && caps.value?.createStrategy === "driver");
|
|
55810
55871
|
let previewTimer = null;
|
|
55811
55872
|
let previewSeq = 0;
|
|
55812
55873
|
async function refreshPreview() {
|
|
55813
55874
|
if (!props.connection?.id) return;
|
|
55814
55875
|
if (props.mode === "edit" && !props.table?.name) return;
|
|
55815
55876
|
if (!formData.value.tableName) return;
|
|
55816
|
-
if (formData.value.columns.some((col) => col.name && !rawType(col))) {
|
|
55817
|
-
previewSql.value = "
|
|
55877
|
+
if (!schemalessCreate.value && formData.value.columns.some((col) => col.name && !rawType(col))) {
|
|
55878
|
+
previewSql.value = t("tableEditor.previewNeedColumns");
|
|
55818
55879
|
return;
|
|
55819
55880
|
}
|
|
55820
55881
|
const seq = ++previewSeq;
|
|
@@ -55823,10 +55884,10 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55823
55884
|
const data = props.mode === "create" ? await databaseService.previewCreateTable(props.connection.id, props.database, spec) : await databaseService.previewAlterTable(props.connection.id, props.database, props.table.name, spec);
|
|
55824
55885
|
if (seq !== previewSeq) return;
|
|
55825
55886
|
if (data?.capabilities) caps.value = data.capabilities;
|
|
55826
|
-
previewSql.value = data?.preview || (props.mode === "create" ? "
|
|
55887
|
+
previewSql.value = data?.preview || (props.mode === "create" ? t("tableEditor.previewCreatePlaceholder") : t("tableEditor.previewNoChanges"));
|
|
55827
55888
|
} catch (error) {
|
|
55828
55889
|
if (seq !== previewSeq) return;
|
|
55829
|
-
previewSql.value =
|
|
55890
|
+
previewSql.value = t("tableEditor.previewFailed", { message: error?.message || error });
|
|
55830
55891
|
}
|
|
55831
55892
|
}
|
|
55832
55893
|
watch(formData, () => {
|
|
@@ -55851,7 +55912,7 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55851
55912
|
await databaseService.refreshTableCache(props.connection.id, props.database);
|
|
55852
55913
|
await refreshPreview();
|
|
55853
55914
|
} catch (error) {
|
|
55854
|
-
await modal.warning(
|
|
55915
|
+
await modal.warning(t("tableEditor.refreshTableListFailed", { message: error?.message || error }));
|
|
55855
55916
|
} finally {
|
|
55856
55917
|
refreshingTables.value = false;
|
|
55857
55918
|
}
|
|
@@ -55891,28 +55952,28 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55891
55952
|
async function submit() {
|
|
55892
55953
|
try {
|
|
55893
55954
|
if (!formData.value.tableName) {
|
|
55894
|
-
await modal.warning("
|
|
55955
|
+
await modal.warning(t("tableEditor.tableNameRequired"));
|
|
55895
55956
|
return;
|
|
55896
55957
|
}
|
|
55897
|
-
if (formData.value.columns.some((col) => !col.name || !rawType(col))) {
|
|
55898
|
-
await modal.warning("
|
|
55958
|
+
if (!schemalessCreate.value && formData.value.columns.some((col) => !col.name || !rawType(col))) {
|
|
55959
|
+
await modal.warning(t("tableEditor.columnsIncomplete"));
|
|
55899
55960
|
return;
|
|
55900
55961
|
}
|
|
55901
55962
|
if (!props.connection?.id) {
|
|
55902
|
-
await modal.warning("
|
|
55963
|
+
await modal.warning(t("tableEditor.connectionRequired"));
|
|
55903
55964
|
return;
|
|
55904
55965
|
}
|
|
55905
55966
|
const result = props.mode === "create" ? await databaseService.executeCreateTable(props.connection.id, props.database, buildTableSpec()) : await databaseService.executeAlterTable(props.connection.id, props.database, props.table.name, buildTableSpec());
|
|
55906
|
-
if (!result?.statements || result.statements.length === 0) {
|
|
55967
|
+
if (!result?.native && (!result?.statements || result.statements.length === 0)) {
|
|
55907
55968
|
const liveCols = result?.liveColumns;
|
|
55908
|
-
const live = liveCols?.length ? liveCols.join("、") : "
|
|
55909
|
-
const tip = liveCols?.length ?
|
|
55910
|
-
await modal.info(
|
|
55969
|
+
const live = liveCols?.length ? liveCols.join("、") : t("tableEditor.liveColumnsUnknown");
|
|
55970
|
+
const tip = liveCols?.length ? t("tableEditor.liveColumnsExist", { columns: live }) : t("tableEditor.liveSchemaMissing");
|
|
55971
|
+
await modal.info(`${t("tableEditor.previewNoChanges")}\n${tip}`);
|
|
55911
55972
|
return;
|
|
55912
55973
|
}
|
|
55913
55974
|
emit("submit", {
|
|
55914
55975
|
success: true,
|
|
55915
|
-
message: props.mode === "create" ? "
|
|
55976
|
+
message: props.mode === "create" ? schemalessCreate.value ? t("tableEditor.createCollectionSuccess") : t("tableEditor.createTableSuccess") : t("tableEditor.alterTableSuccess"),
|
|
55916
55977
|
data: result,
|
|
55917
55978
|
mode: props.mode
|
|
55918
55979
|
});
|
|
@@ -55935,7 +55996,7 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55935
55996
|
if (newVal) {
|
|
55936
55997
|
initFormData();
|
|
55937
55998
|
caps.value = null;
|
|
55938
|
-
previewSql.value = "
|
|
55999
|
+
previewSql.value = t("tableEditor.previewCreateSqlPlaceholder");
|
|
55939
56000
|
setTimeout(refreshPreview, 0);
|
|
55940
56001
|
}
|
|
55941
56002
|
});
|
|
@@ -55981,47 +56042,51 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
55981
56042
|
if (props.visible) initFormData();
|
|
55982
56043
|
});
|
|
55983
56044
|
return (_ctx, _cache) => {
|
|
55984
|
-
return __props.visible ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
56045
|
+
return __props.visible ? (openBlock(), createElementBlock("div", _hoisted_1$7, [createBaseVNode("div", {
|
|
55985
56046
|
class: "modal-dialog modal-lg",
|
|
55986
56047
|
style: {
|
|
55987
56048
|
"width": "80%",
|
|
55988
56049
|
"max-width": "none"
|
|
55989
56050
|
},
|
|
55990
56051
|
onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"]))
|
|
55991
|
-
}, [createBaseVNode("div", _hoisted_2$
|
|
55992
|
-
createBaseVNode("div", _hoisted_3$
|
|
56052
|
+
}, [createBaseVNode("div", _hoisted_2$7, [
|
|
56053
|
+
createBaseVNode("div", _hoisted_3$7, [createBaseVNode("h5", _hoisted_4$7, [_cache[3] || (_cache[3] = createBaseVNode("i", { class: "bi bi-pencil-square me-2" }, null, -1)), createTextVNode(" " + toDisplayString(__props.mode === "create" ? _ctx.$t("tableEditor.createNewTable") : _ctx.$t("tableEditor.modifyStructure")), 1)]), createBaseVNode("button", {
|
|
55993
56054
|
type: "button",
|
|
55994
56055
|
class: "btn-close",
|
|
55995
56056
|
onClick: close
|
|
55996
56057
|
})]),
|
|
55997
|
-
createBaseVNode("div", _hoisted_5$
|
|
55998
|
-
createBaseVNode("div", _hoisted_6$
|
|
56058
|
+
createBaseVNode("div", _hoisted_5$7, [
|
|
56059
|
+
createBaseVNode("div", _hoisted_6$7, [createBaseVNode("h6", _hoisted_7$7, toDisplayString(_ctx.$t("tableEditor.tableInfo")), 1), createBaseVNode("div", _hoisted_8$7, [createBaseVNode("div", _hoisted_9$7, [createBaseVNode("div", _hoisted_10$7, [createBaseVNode("label", _hoisted_11$7, toDisplayString(_ctx.$t("tableEditor.tableNameLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
55999
56060
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.tableName = $event),
|
|
56000
56061
|
type: "text",
|
|
56001
56062
|
class: "form-control",
|
|
56002
56063
|
disabled: __props.mode === "edit",
|
|
56003
56064
|
placeholder: _ctx.$t("tableEditor.tableNamePlaceholder")
|
|
56004
|
-
}, null, 8, _hoisted_12$
|
|
56065
|
+
}, null, 8, _hoisted_12$7), [[vModelText, formData.value.tableName]])])]), createBaseVNode("div", _hoisted_13$7, [createBaseVNode("div", _hoisted_14$7, [createBaseVNode("label", _hoisted_15$7, toDisplayString(_ctx.$t("tableEditor.tableCommentLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
56005
56066
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.value.tableComment = $event),
|
|
56006
56067
|
type: "text",
|
|
56007
56068
|
class: "form-control",
|
|
56008
56069
|
disabled: tableCommentDisabled.value,
|
|
56009
|
-
title: tableCommentDisabled.value ? "
|
|
56070
|
+
title: tableCommentDisabled.value ? _ctx.$t("tableEditor.tableCommentUnsupported") : void 0,
|
|
56010
56071
|
placeholder: _ctx.$t("tableEditor.tableCommentPlaceholder")
|
|
56011
|
-
}, null, 8, _hoisted_16$
|
|
56012
|
-
|
|
56072
|
+
}, null, 8, _hoisted_16$7), [[vModelText, formData.value.tableComment]])])])])]),
|
|
56073
|
+
schemalessCreate.value ? (openBlock(), createElementBlock("div", {
|
|
56074
|
+
key: 0,
|
|
56075
|
+
class: "alert alert-info py-2 small mb-4",
|
|
56076
|
+
innerHTML: _ctx.$t("tableEditor.schemalessHint")
|
|
56077
|
+
}, null, 8, _hoisted_17$7)) : (openBlock(), createElementBlock("div", _hoisted_18$6, [createBaseVNode("div", _hoisted_19$6, [createBaseVNode("h6", _hoisted_20$6, toDisplayString(_ctx.$t("tableEditor.columnManagement")), 1), createBaseVNode("button", {
|
|
56013
56078
|
class: "btn btn-success btn-sm",
|
|
56014
56079
|
onClick: addColumn
|
|
56015
|
-
}, [_cache[4] || (_cache[4] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableEditor.addColumn")), 1)])]), createBaseVNode("div",
|
|
56016
|
-
createBaseVNode("th",
|
|
56017
|
-
createBaseVNode("th",
|
|
56018
|
-
createBaseVNode("th",
|
|
56019
|
-
createBaseVNode("th",
|
|
56020
|
-
createBaseVNode("th",
|
|
56021
|
-
createBaseVNode("th",
|
|
56022
|
-
createBaseVNode("th",
|
|
56080
|
+
}, [_cache[4] || (_cache[4] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableEditor.addColumn")), 1)])]), createBaseVNode("div", _hoisted_21$6, [createBaseVNode("table", _hoisted_22$6, [createBaseVNode("thead", null, [createBaseVNode("tr", null, [
|
|
56081
|
+
createBaseVNode("th", _hoisted_23$6, toDisplayString(_ctx.$t("tableEditor.columnNameHeader")), 1),
|
|
56082
|
+
createBaseVNode("th", _hoisted_24$6, toDisplayString(_ctx.$t("tableEditor.dataTypeHeader")), 1),
|
|
56083
|
+
createBaseVNode("th", _hoisted_25$6, toDisplayString(_ctx.$t("tableEditor.lengthPrecisionHeader")), 1),
|
|
56084
|
+
createBaseVNode("th", _hoisted_26$5, toDisplayString(_ctx.$t("tableEditor.nullableHeader")), 1),
|
|
56085
|
+
createBaseVNode("th", _hoisted_27$5, toDisplayString(_ctx.$t("tableEditor.defaultHeader")), 1),
|
|
56086
|
+
createBaseVNode("th", _hoisted_28$5, toDisplayString(_ctx.$t("tableEditor.primaryKeyHeader")), 1),
|
|
56087
|
+
createBaseVNode("th", _hoisted_29$5, toDisplayString(_ctx.$t("tableEditor.autoIncHeader")), 1),
|
|
56023
56088
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableEditor.commentHeader")), 1),
|
|
56024
|
-
createBaseVNode("th",
|
|
56089
|
+
createBaseVNode("th", _hoisted_30$5, toDisplayString(_ctx.$t("tableEditor.operationsHeader")), 1)
|
|
56025
56090
|
])]), createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(formData.value.columns, (column, index) => {
|
|
56026
56091
|
return openBlock(), createElementBlock("tr", { key: index }, [
|
|
56027
56092
|
createBaseVNode("td", null, [withDirectives(createBaseVNode("input", {
|
|
@@ -56031,12 +56096,12 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56031
56096
|
disabled: renameDisabled.value,
|
|
56032
56097
|
title: renameDisabled.value ? "该数据库不支持修改列名" : void 0,
|
|
56033
56098
|
placeholder: _ctx.$t("tableEditor.columnNamePlaceholder")
|
|
56034
|
-
}, null, 8,
|
|
56099
|
+
}, null, 8, _hoisted_31$5), [[vModelText, column.name]])]),
|
|
56035
56100
|
createBaseVNode("td", null, [withDirectives(createBaseVNode("select", {
|
|
56036
56101
|
"onUpdate:modelValue": ($event) => column.type = $event,
|
|
56037
56102
|
class: "form-select form-select-sm"
|
|
56038
56103
|
}, [
|
|
56039
|
-
createBaseVNode("option",
|
|
56104
|
+
createBaseVNode("option", _hoisted_33$5, toDisplayString(_ctx.$t("tableEditor.selectType")), 1),
|
|
56040
56105
|
(openBlock(true), createElementBlock(Fragment, null, renderList(columnTypesByCategory.value, (types, category) => {
|
|
56041
56106
|
return openBlock(), createElementBlock("optgroup", {
|
|
56042
56107
|
key: category,
|
|
@@ -56045,67 +56110,67 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56045
56110
|
return openBlock(), createElementBlock("option", {
|
|
56046
56111
|
key: type.name,
|
|
56047
56112
|
value: type.name
|
|
56048
|
-
}, toDisplayString(type.label), 9,
|
|
56049
|
-
}), 128))], 8,
|
|
56113
|
+
}, toDisplayString(type.label), 9, _hoisted_35$5);
|
|
56114
|
+
}), 128))], 8, _hoisted_34$5);
|
|
56050
56115
|
}), 128)),
|
|
56051
56116
|
createBaseVNode("option", { value: CUSTOM_TYPE_VALUE }, toDisplayString(_ctx.$t("tableEditor.customType")), 1)
|
|
56052
|
-
], 8,
|
|
56117
|
+
], 8, _hoisted_32$5), [[vModelSelect, column.type]]), column.type === CUSTOM_TYPE_VALUE ? withDirectives((openBlock(), createElementBlock("input", {
|
|
56053
56118
|
key: 0,
|
|
56054
56119
|
"onUpdate:modelValue": ($event) => column.customType = $event,
|
|
56055
56120
|
type: "text",
|
|
56056
56121
|
class: "form-control form-control-sm mt-1",
|
|
56057
56122
|
placeholder: _ctx.$t("tableEditor.customTypePlaceholder")
|
|
56058
|
-
}, null, 8,
|
|
56059
|
-
createBaseVNode("td", null, [needsLength(column) || needsPrecision(column) ? (openBlock(), createElementBlock("div",
|
|
56123
|
+
}, null, 8, _hoisted_36$4)), [[vModelText, column.customType]]) : createCommentVNode("", true)]),
|
|
56124
|
+
createBaseVNode("td", null, [needsLength(column) || needsPrecision(column) ? (openBlock(), createElementBlock("div", _hoisted_37$4, [
|
|
56060
56125
|
needsLength(column) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
56061
56126
|
key: 0,
|
|
56062
56127
|
"onUpdate:modelValue": ($event) => column.length = $event,
|
|
56063
56128
|
type: "number",
|
|
56064
56129
|
class: "form-control form-control-sm",
|
|
56065
56130
|
placeholder: _ctx.$t("tableEditor.lengthPlaceholder")
|
|
56066
|
-
}, null, 8,
|
|
56131
|
+
}, null, 8, _hoisted_38$4)), [[vModelText, column.length]]) : createCommentVNode("", true),
|
|
56067
56132
|
needsPrecision(column) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
56068
56133
|
key: 1,
|
|
56069
56134
|
"onUpdate:modelValue": ($event) => column.precision = $event,
|
|
56070
56135
|
type: "number",
|
|
56071
56136
|
class: "form-control form-control-sm",
|
|
56072
56137
|
placeholder: _ctx.$t("tableEditor.precisionPlaceholder")
|
|
56073
|
-
}, null, 8,
|
|
56138
|
+
}, null, 8, _hoisted_39$4)), [[vModelText, column.precision]]) : createCommentVNode("", true),
|
|
56074
56139
|
needsScale(column) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
56075
56140
|
key: 2,
|
|
56076
56141
|
"onUpdate:modelValue": ($event) => column.scale = $event,
|
|
56077
56142
|
type: "number",
|
|
56078
56143
|
class: "form-control form-control-sm",
|
|
56079
56144
|
placeholder: _ctx.$t("tableEditor.scalePlaceholder")
|
|
56080
|
-
}, null, 8,
|
|
56081
|
-
])) : (openBlock(), createElementBlock("span",
|
|
56082
|
-
createBaseVNode("td", null, [createBaseVNode("div",
|
|
56145
|
+
}, null, 8, _hoisted_40$4)), [[vModelText, column.scale]]) : createCommentVNode("", true)
|
|
56146
|
+
])) : (openBlock(), createElementBlock("span", _hoisted_41$4, "-"))]),
|
|
56147
|
+
createBaseVNode("td", null, [createBaseVNode("div", _hoisted_42$4, [withDirectives(createBaseVNode("input", {
|
|
56083
56148
|
"onUpdate:modelValue": ($event) => column.nullable = $event,
|
|
56084
56149
|
type: "checkbox",
|
|
56085
56150
|
class: "form-check-input"
|
|
56086
|
-
}, null, 8,
|
|
56151
|
+
}, null, 8, _hoisted_43$4), [[vModelCheckbox, column.nullable]])])]),
|
|
56087
56152
|
createBaseVNode("td", null, [withDirectives(createBaseVNode("input", {
|
|
56088
56153
|
"onUpdate:modelValue": ($event) => column.defaultValue = $event,
|
|
56089
56154
|
type: "text",
|
|
56090
56155
|
class: "form-control form-control-sm",
|
|
56091
56156
|
placeholder: _ctx.$t("tableEditor.defaultHeader")
|
|
56092
|
-
}, null, 8,
|
|
56093
|
-
createBaseVNode("td", null, [createBaseVNode("div",
|
|
56157
|
+
}, null, 8, _hoisted_44$4), [[vModelText, column.defaultValue]])]),
|
|
56158
|
+
createBaseVNode("td", null, [createBaseVNode("div", _hoisted_45$4, [withDirectives(createBaseVNode("input", {
|
|
56094
56159
|
"onUpdate:modelValue": ($event) => column.isPrimary = $event,
|
|
56095
56160
|
type: "checkbox",
|
|
56096
56161
|
class: "form-check-input",
|
|
56097
56162
|
disabled: pkDisabled.value,
|
|
56098
56163
|
title: pkDisabled.value ? "该数据库不支持在线修改主键" : void 0,
|
|
56099
56164
|
onChange: ($event) => onPrimaryKeyChange(column)
|
|
56100
|
-
}, null, 40,
|
|
56101
|
-
createBaseVNode("td", null, [createBaseVNode("div",
|
|
56165
|
+
}, null, 40, _hoisted_46$4), [[vModelCheckbox, column.isPrimary]])])]),
|
|
56166
|
+
createBaseVNode("td", null, [createBaseVNode("div", _hoisted_47$4, [withDirectives(createBaseVNode("input", {
|
|
56102
56167
|
"onUpdate:modelValue": ($event) => column.isAutoIncrement = $event,
|
|
56103
56168
|
type: "checkbox",
|
|
56104
56169
|
class: "form-check-input",
|
|
56105
56170
|
disabled: !column.isPrimary || !supportsAutoIncrement(column),
|
|
56106
56171
|
title: supportsAutoIncrement(column) ? "自增列将作为唯一主键" : void 0,
|
|
56107
56172
|
onChange: ($event) => onAutoIncrementChange(column, index)
|
|
56108
|
-
}, null, 40,
|
|
56173
|
+
}, null, 40, _hoisted_48$3), [[vModelCheckbox, column.isAutoIncrement]])])]),
|
|
56109
56174
|
createBaseVNode("td", null, [withDirectives(createBaseVNode("input", {
|
|
56110
56175
|
"onUpdate:modelValue": ($event) => column.comment = $event,
|
|
56111
56176
|
type: "text",
|
|
@@ -56113,23 +56178,23 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56113
56178
|
disabled: columnCommentDisabled.value,
|
|
56114
56179
|
title: columnCommentDisabled.value ? "该数据库不支持列注释" : void 0,
|
|
56115
56180
|
placeholder: _ctx.$t("tableEditor.fieldComment")
|
|
56116
|
-
}, null, 8,
|
|
56181
|
+
}, null, 8, _hoisted_49$3), [[vModelText, column.comment]])]),
|
|
56117
56182
|
createBaseVNode("td", null, [createBaseVNode("button", {
|
|
56118
56183
|
class: "btn btn-outline-danger btn-sm",
|
|
56119
56184
|
onClick: ($event) => removeColumn(index),
|
|
56120
56185
|
disabled: formData.value.columns.length <= 1
|
|
56121
|
-
}, [..._cache[5] || (_cache[5] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8,
|
|
56186
|
+
}, [..._cache[5] || (_cache[5] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_50$3)])
|
|
56122
56187
|
]);
|
|
56123
|
-
}), 128))])])])]),
|
|
56124
|
-
createBaseVNode("div",
|
|
56188
|
+
}), 128))])])])])),
|
|
56189
|
+
createBaseVNode("div", _hoisted_51$3, [createBaseVNode("div", _hoisted_52$3, [createBaseVNode("h6", _hoisted_53$3, toDisplayString(_ctx.$t("tableEditor.sqlPreview")), 1), createBaseVNode("button", {
|
|
56125
56190
|
type: "button",
|
|
56126
56191
|
class: "btn btn-sm btn-outline-secondary",
|
|
56127
56192
|
disabled: refreshingTables.value,
|
|
56128
|
-
title: "
|
|
56193
|
+
title: _ctx.$t("tableEditor.refreshTableListTip"),
|
|
56129
56194
|
onClick: refreshTableList
|
|
56130
|
-
}, toDisplayString(refreshingTables.value ? "
|
|
56195
|
+
}, toDisplayString(refreshingTables.value ? _ctx.$t("tableEditor.refreshing") : _ctx.$t("tableEditor.refreshTableList")), 9, _hoisted_54$3)]), createBaseVNode("pre", _hoisted_55$3, toDisplayString(previewSql.value), 1)])
|
|
56131
56196
|
]),
|
|
56132
|
-
createBaseVNode("div",
|
|
56197
|
+
createBaseVNode("div", _hoisted_56$3, [createBaseVNode("button", {
|
|
56133
56198
|
type: "button",
|
|
56134
56199
|
class: "btn btn-secondary",
|
|
56135
56200
|
onClick: close
|
|
@@ -56139,28 +56204,203 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56139
56204
|
disabled: submitDisabled.value,
|
|
56140
56205
|
title: submitDisabledHint.value || void 0,
|
|
56141
56206
|
onClick: submit
|
|
56142
|
-
}, toDisplayString(_ctx.$t("common.save")), 9,
|
|
56207
|
+
}, toDisplayString(_ctx.$t("common.save")), 9, _hoisted_57$3)])
|
|
56143
56208
|
])])])) : createCommentVNode("", true);
|
|
56144
56209
|
};
|
|
56145
56210
|
}
|
|
56146
56211
|
});
|
|
56147
56212
|
}));
|
|
56148
56213
|
//#endregion
|
|
56149
|
-
//#region src/platform/database/components/table-editor.vue?vue&type=style&index=0&scoped=
|
|
56150
|
-
var
|
|
56214
|
+
//#region src/platform/database/components/table-editor.vue?vue&type=style&index=0&scoped=6c4a9ebd&lang.css
|
|
56215
|
+
var init_table_editor_vue_vue_type_style_index_0_scoped_6c4a9ebd_lang = __esmMin((() => {}));
|
|
56151
56216
|
//#endregion
|
|
56152
56217
|
//#region src/platform/database/components/table-editor.vue
|
|
56153
56218
|
var table_editor_default;
|
|
56154
56219
|
var init_table_editor = __esmMin((() => {
|
|
56155
56220
|
init_table_editor_vue_vue_type_script_setup_true_lang();
|
|
56156
56221
|
init_table_editor_vue_vue_type_script_setup_true_lang();
|
|
56157
|
-
|
|
56222
|
+
init_table_editor_vue_vue_type_style_index_0_scoped_6c4a9ebd_lang();
|
|
56223
|
+
init__plugin_vue_export_helper();
|
|
56224
|
+
table_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-6c4a9ebd"]]);
|
|
56225
|
+
}));
|
|
56226
|
+
//#endregion
|
|
56227
|
+
//#region src/platform/database/components/document-query-panel.vue?vue&type=script&setup=true&lang.ts
|
|
56228
|
+
var _hoisted_1$6, _hoisted_2$6, _hoisted_3$6, _hoisted_4$6, _hoisted_5$6, _hoisted_6$6, _hoisted_7$6, _hoisted_8$6, _hoisted_9$6, _hoisted_10$6, _hoisted_11$6, _hoisted_12$6, _hoisted_13$6, _hoisted_14$6, _hoisted_15$6, _hoisted_16$6, _hoisted_17$6, document_query_panel_vue_vue_type_script_setup_true_lang_default;
|
|
56229
|
+
var init_document_query_panel_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
56230
|
+
init_vue_runtime_esm_bundler();
|
|
56231
|
+
init_vue_i18n();
|
|
56232
|
+
init_database();
|
|
56233
|
+
_hoisted_1$6 = { class: "document-query-panel" };
|
|
56234
|
+
_hoisted_2$6 = { class: "query-toolbar d-flex flex-wrap gap-2 align-items-center mb-2" };
|
|
56235
|
+
_hoisted_3$6 = ["value"];
|
|
56236
|
+
_hoisted_4$6 = {
|
|
56237
|
+
class: "btn-group btn-group-sm",
|
|
56238
|
+
role: "group"
|
|
56239
|
+
};
|
|
56240
|
+
_hoisted_5$6 = ["placeholder"];
|
|
56241
|
+
_hoisted_6$6 = ["disabled"];
|
|
56242
|
+
_hoisted_7$6 = {
|
|
56243
|
+
key: 1,
|
|
56244
|
+
class: "text-muted small"
|
|
56245
|
+
};
|
|
56246
|
+
_hoisted_8$6 = { class: "row g-2" };
|
|
56247
|
+
_hoisted_9$6 = { class: "col-md-5" };
|
|
56248
|
+
_hoisted_10$6 = { class: "form-label small" };
|
|
56249
|
+
_hoisted_11$6 = ["placeholder"];
|
|
56250
|
+
_hoisted_12$6 = { class: "text-muted small mt-1" };
|
|
56251
|
+
_hoisted_13$6 = { class: "col-md-7" };
|
|
56252
|
+
_hoisted_14$6 = { class: "form-label small" };
|
|
56253
|
+
_hoisted_15$6 = {
|
|
56254
|
+
key: 0,
|
|
56255
|
+
class: "alert alert-danger py-2 small"
|
|
56256
|
+
};
|
|
56257
|
+
_hoisted_16$6 = {
|
|
56258
|
+
key: 1,
|
|
56259
|
+
class: "text-muted small"
|
|
56260
|
+
};
|
|
56261
|
+
_hoisted_17$6 = {
|
|
56262
|
+
key: 2,
|
|
56263
|
+
class: "result-json"
|
|
56264
|
+
};
|
|
56265
|
+
document_query_panel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
56266
|
+
__name: "document-query-panel",
|
|
56267
|
+
props: {
|
|
56268
|
+
connection: {},
|
|
56269
|
+
database: {},
|
|
56270
|
+
tables: {}
|
|
56271
|
+
},
|
|
56272
|
+
setup(__props) {
|
|
56273
|
+
const { t } = useI18n();
|
|
56274
|
+
const props = __props;
|
|
56275
|
+
const databaseService = new DatabaseService();
|
|
56276
|
+
const mode = ref("find");
|
|
56277
|
+
const collection = ref("");
|
|
56278
|
+
const queryText = ref("{\n \n}");
|
|
56279
|
+
const sort = ref("");
|
|
56280
|
+
const pageSize = ref(50);
|
|
56281
|
+
const result = ref([]);
|
|
56282
|
+
const total = ref(null);
|
|
56283
|
+
const loading = ref(false);
|
|
56284
|
+
const error = ref("");
|
|
56285
|
+
watch(() => props.tables, (list) => {
|
|
56286
|
+
const first = list?.[0];
|
|
56287
|
+
if (first && !collection.value) collection.value = String(first.name);
|
|
56288
|
+
}, {
|
|
56289
|
+
immediate: true,
|
|
56290
|
+
deep: true
|
|
56291
|
+
});
|
|
56292
|
+
watch(mode, (m) => {
|
|
56293
|
+
result.value = [];
|
|
56294
|
+
total.value = null;
|
|
56295
|
+
error.value = "";
|
|
56296
|
+
queryText.value = m === "find" ? "{\n \n}" : "[\n \n]";
|
|
56297
|
+
});
|
|
56298
|
+
async function run() {
|
|
56299
|
+
if (!props.connection?.id || !collection.value) return;
|
|
56300
|
+
error.value = "";
|
|
56301
|
+
loading.value = true;
|
|
56302
|
+
try {
|
|
56303
|
+
const trimmed = queryText.value.trim();
|
|
56304
|
+
const parsed = trimmed ? JSON.parse(trimmed) : mode.value === "find" ? {} : [];
|
|
56305
|
+
if (mode.value === "find") {
|
|
56306
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
56307
|
+
error.value = t("documentQuery.filterMustBeObject");
|
|
56308
|
+
return;
|
|
56309
|
+
}
|
|
56310
|
+
const res = await databaseService.getTableData(props.connection.id, props.database, collection.value, 1, pageSize.value, Object.keys(parsed).length ? JSON.stringify(parsed) : void 0, sort.value.trim() || void 0);
|
|
56311
|
+
result.value = res?.data?.data || [];
|
|
56312
|
+
total.value = res?.data?.total ?? 0;
|
|
56313
|
+
} else {
|
|
56314
|
+
if (!Array.isArray(parsed)) {
|
|
56315
|
+
error.value = t("documentQuery.aggregateMustBeArray");
|
|
56316
|
+
return;
|
|
56317
|
+
}
|
|
56318
|
+
const res = await databaseService.aggregate(props.connection.id, props.database, collection.value, parsed);
|
|
56319
|
+
result.value = res?.data || [];
|
|
56320
|
+
total.value = result.value.length;
|
|
56321
|
+
}
|
|
56322
|
+
} catch (e) {
|
|
56323
|
+
error.value = e?.message || String(e);
|
|
56324
|
+
result.value = [];
|
|
56325
|
+
} finally {
|
|
56326
|
+
loading.value = false;
|
|
56327
|
+
}
|
|
56328
|
+
}
|
|
56329
|
+
return (_ctx, _cache) => {
|
|
56330
|
+
return openBlock(), createElementBlock("div", _hoisted_1$6, [createBaseVNode("div", _hoisted_2$6, [
|
|
56331
|
+
withDirectives(createBaseVNode("select", {
|
|
56332
|
+
class: "form-select form-select-sm",
|
|
56333
|
+
style: { "width": "220px" },
|
|
56334
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => collection.value = $event)
|
|
56335
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tables, (t) => {
|
|
56336
|
+
return openBlock(), createElementBlock("option", {
|
|
56337
|
+
key: t.name,
|
|
56338
|
+
value: t.name
|
|
56339
|
+
}, toDisplayString(t.name), 9, _hoisted_3$6);
|
|
56340
|
+
}), 128))], 512), [[vModelSelect, collection.value]]),
|
|
56341
|
+
createBaseVNode("div", _hoisted_4$6, [createBaseVNode("button", {
|
|
56342
|
+
class: normalizeClass(["btn", mode.value === "find" ? "btn-primary" : "btn-outline-primary"]),
|
|
56343
|
+
onClick: _cache[1] || (_cache[1] = ($event) => mode.value = "find")
|
|
56344
|
+
}, toDisplayString(_ctx.$t("documentQuery.filterTab")), 3), createBaseVNode("button", {
|
|
56345
|
+
class: normalizeClass(["btn", mode.value === "aggregate" ? "btn-primary" : "btn-outline-primary"]),
|
|
56346
|
+
onClick: _cache[2] || (_cache[2] = ($event) => mode.value = "aggregate")
|
|
56347
|
+
}, toDisplayString(_ctx.$t("documentQuery.aggregateTab")), 3)]),
|
|
56348
|
+
mode.value === "find" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [withDirectives(createBaseVNode("input", {
|
|
56349
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => sort.value = $event),
|
|
56350
|
+
class: "form-control form-control-sm",
|
|
56351
|
+
style: { "width": "180px" },
|
|
56352
|
+
placeholder: _ctx.$t("documentQuery.sortPlaceholder")
|
|
56353
|
+
}, null, 8, _hoisted_5$6), [[vModelText, sort.value]]), withDirectives(createBaseVNode("select", {
|
|
56354
|
+
class: "form-select form-select-sm",
|
|
56355
|
+
style: { "width": "90px" },
|
|
56356
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => pageSize.value = $event)
|
|
56357
|
+
}, [..._cache[6] || (_cache[6] = [
|
|
56358
|
+
createBaseVNode("option", { value: 20 }, "20", -1),
|
|
56359
|
+
createBaseVNode("option", { value: 50 }, "50", -1),
|
|
56360
|
+
createBaseVNode("option", { value: 100 }, "100", -1)
|
|
56361
|
+
])], 512), [[
|
|
56362
|
+
vModelSelect,
|
|
56363
|
+
pageSize.value,
|
|
56364
|
+
void 0,
|
|
56365
|
+
{ number: true }
|
|
56366
|
+
]])], 64)) : createCommentVNode("", true),
|
|
56367
|
+
createBaseVNode("button", {
|
|
56368
|
+
class: "btn btn-success btn-sm",
|
|
56369
|
+
disabled: loading.value || !collection.value,
|
|
56370
|
+
onClick: run
|
|
56371
|
+
}, [_cache[7] || (_cache[7] = createBaseVNode("i", { class: "bi bi-play-fill" }, null, -1)), createTextVNode(" " + toDisplayString(loading.value ? _ctx.$t("documentQuery.executing") : _ctx.$t("documentQuery.execute")), 1)], 8, _hoisted_6$6),
|
|
56372
|
+
total.value !== null ? (openBlock(), createElementBlock("span", _hoisted_7$6, toDisplayString(_ctx.$t("documentQuery.totalLabel", { count: total.value })), 1)) : createCommentVNode("", true)
|
|
56373
|
+
]), createBaseVNode("div", _hoisted_8$6, [createBaseVNode("div", _hoisted_9$6, [
|
|
56374
|
+
createBaseVNode("label", _hoisted_10$6, toDisplayString(mode.value === "find" ? _ctx.$t("documentQuery.filterLabel") : _ctx.$t("documentQuery.aggregateLabel")), 1),
|
|
56375
|
+
withDirectives(createBaseVNode("textarea", {
|
|
56376
|
+
class: "form-control font-monospace",
|
|
56377
|
+
rows: "12",
|
|
56378
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => queryText.value = $event),
|
|
56379
|
+
spellcheck: "false",
|
|
56380
|
+
placeholder: mode.value === "find" ? "{\n \"status\": \"active\"\n}" : "[\n { \"$group\": { \"_id\": \"$status\", \"count\": { \"$sum\": 1 } } }\n]"
|
|
56381
|
+
}, null, 8, _hoisted_11$6), [[vModelText, queryText.value]]),
|
|
56382
|
+
createBaseVNode("div", _hoisted_12$6, toDisplayString(mode.value === "find" ? _ctx.$t("documentQuery.filterHint") : _ctx.$t("documentQuery.aggregateHint")), 1)
|
|
56383
|
+
]), createBaseVNode("div", _hoisted_13$6, [createBaseVNode("label", _hoisted_14$6, toDisplayString(_ctx.$t("documentQuery.result")), 1), error.value ? (openBlock(), createElementBlock("div", _hoisted_15$6, toDisplayString(error.value), 1)) : result.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_16$6, toDisplayString(_ctx.$t("documentQuery.noResult")), 1)) : (openBlock(), createElementBlock("pre", _hoisted_17$6, toDisplayString(JSON.stringify(result.value, null, 2)), 1))])])]);
|
|
56384
|
+
};
|
|
56385
|
+
}
|
|
56386
|
+
});
|
|
56387
|
+
}));
|
|
56388
|
+
//#endregion
|
|
56389
|
+
//#region src/platform/database/components/document-query-panel.vue?vue&type=style&index=0&scoped=ba41948d&lang.css
|
|
56390
|
+
var init_document_query_panel_vue_vue_type_style_index_0_scoped_ba41948d_lang = __esmMin((() => {}));
|
|
56391
|
+
//#endregion
|
|
56392
|
+
//#region src/platform/database/components/document-query-panel.vue
|
|
56393
|
+
var document_query_panel_default;
|
|
56394
|
+
var init_document_query_panel = __esmMin((() => {
|
|
56395
|
+
init_document_query_panel_vue_vue_type_script_setup_true_lang();
|
|
56396
|
+
init_document_query_panel_vue_vue_type_script_setup_true_lang();
|
|
56397
|
+
init_document_query_panel_vue_vue_type_style_index_0_scoped_ba41948d_lang();
|
|
56158
56398
|
init__plugin_vue_export_helper();
|
|
56159
|
-
|
|
56399
|
+
document_query_panel_default = /*#__PURE__*/ _plugin_vue_export_helper_default(document_query_panel_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ba41948d"]]);
|
|
56160
56400
|
}));
|
|
56161
56401
|
//#endregion
|
|
56162
56402
|
//#region src/platform/database/components/db-tools.vue?vue&type=script&setup=true&lang.ts
|
|
56163
|
-
var _hoisted_1$5, _hoisted_2$5, _hoisted_3$5, _hoisted_4$5, _hoisted_5$5, _hoisted_6$5, _hoisted_7$5, _hoisted_8$5, _hoisted_9$5, _hoisted_10$5, _hoisted_11$5, _hoisted_12$5, _hoisted_13$5, _hoisted_14$5, _hoisted_15$5, _hoisted_16$5, _hoisted_17$5, _hoisted_18$5, _hoisted_19$5, _hoisted_20$5, _hoisted_21$5, _hoisted_22$5, _hoisted_23$5, _hoisted_24$5, _hoisted_25$5, _hoisted_26$4, _hoisted_27$4, _hoisted_28$4, _hoisted_29$4, _hoisted_30$
|
|
56403
|
+
var _hoisted_1$5, _hoisted_2$5, _hoisted_3$5, _hoisted_4$5, _hoisted_5$5, _hoisted_6$5, _hoisted_7$5, _hoisted_8$5, _hoisted_9$5, _hoisted_10$5, _hoisted_11$5, _hoisted_12$5, _hoisted_13$5, _hoisted_14$5, _hoisted_15$5, _hoisted_16$5, _hoisted_17$5, _hoisted_18$5, _hoisted_19$5, _hoisted_20$5, _hoisted_21$5, _hoisted_22$5, _hoisted_23$5, _hoisted_24$5, _hoisted_25$5, _hoisted_26$4, _hoisted_27$4, _hoisted_28$4, _hoisted_29$4, _hoisted_30$4, _hoisted_31$4, _hoisted_32$4, _hoisted_33$4, _hoisted_34$4, _hoisted_35$4, _hoisted_36$3, _hoisted_37$3, _hoisted_38$3, _hoisted_39$3, _hoisted_40$3, _hoisted_41$3, _hoisted_42$3, _hoisted_43$3, _hoisted_44$3, _hoisted_45$3, _hoisted_46$3, _hoisted_47$3, _hoisted_48$2, _hoisted_49$2, _hoisted_50$2, _hoisted_51$2, _hoisted_52$2, _hoisted_53$2, _hoisted_54$2, _hoisted_55$2, _hoisted_56$2, _hoisted_57$2, _hoisted_58$2, _hoisted_59$2, _hoisted_60$2, _hoisted_61$2, _hoisted_62$2, _hoisted_63$2, _hoisted_64$2, _hoisted_65$2, _hoisted_66$2, _hoisted_67$2, _hoisted_68$2, _hoisted_69$2, _hoisted_70$2, _hoisted_71$2, _hoisted_72$2, _hoisted_73$2, _hoisted_74$2, _hoisted_75$2, _hoisted_76$2, _hoisted_77$2, _hoisted_78$2, _hoisted_79$2, _hoisted_80$2, _hoisted_81$2, _hoisted_82$2, _hoisted_83$2, _hoisted_84$1, _hoisted_85$1, _hoisted_86$1, _hoisted_87$1, _hoisted_88$1, _hoisted_89$1, _hoisted_90$1, _hoisted_91$1, _hoisted_92$1, _hoisted_93$1, _hoisted_94$1, _hoisted_95$1, _hoisted_96$1, _hoisted_97$1, _hoisted_98$1, _hoisted_99$1, _hoisted_100$1, _hoisted_101$1, _hoisted_102$1, _hoisted_103$1, _hoisted_104$1, _hoisted_105$1, _hoisted_106$1, _hoisted_107$1, _hoisted_108$1, db_tools_vue_vue_type_script_setup_true_lang_default;
|
|
56164
56404
|
var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
56165
56405
|
init_vue_runtime_esm_bundler();
|
|
56166
56406
|
init_vue_i18n();
|
|
@@ -56202,12 +56442,12 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56202
56442
|
_hoisted_27$4 = { class: "mb-4" };
|
|
56203
56443
|
_hoisted_28$4 = { class: "text-primary mb-2" };
|
|
56204
56444
|
_hoisted_29$4 = { class: "row g-3" };
|
|
56205
|
-
_hoisted_30$
|
|
56206
|
-
_hoisted_31$
|
|
56207
|
-
_hoisted_32$
|
|
56208
|
-
_hoisted_33$
|
|
56209
|
-
_hoisted_34$
|
|
56210
|
-
_hoisted_35$
|
|
56445
|
+
_hoisted_30$4 = { class: "col-md-6" };
|
|
56446
|
+
_hoisted_31$4 = { class: "form-label" };
|
|
56447
|
+
_hoisted_32$4 = { class: "col-md-6" };
|
|
56448
|
+
_hoisted_33$4 = { class: "form-label" };
|
|
56449
|
+
_hoisted_34$4 = { value: "" };
|
|
56450
|
+
_hoisted_35$4 = ["value"];
|
|
56211
56451
|
_hoisted_36$3 = { class: "mb-4" };
|
|
56212
56452
|
_hoisted_37$3 = { class: "text-primary mb-2" };
|
|
56213
56453
|
_hoisted_38$3 = { class: "mb-3" };
|
|
@@ -56225,7 +56465,7 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56225
56465
|
_hoisted_44$3 = { value: "" };
|
|
56226
56466
|
_hoisted_45$3 = ["value"];
|
|
56227
56467
|
_hoisted_46$3 = { class: "col-md-6" };
|
|
56228
|
-
_hoisted_47$
|
|
56468
|
+
_hoisted_47$3 = { class: "form-label" };
|
|
56229
56469
|
_hoisted_48$2 = { value: "" };
|
|
56230
56470
|
_hoisted_49$2 = ["value"];
|
|
56231
56471
|
_hoisted_50$2 = { class: "col-md-12" };
|
|
@@ -56253,30 +56493,30 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56253
56493
|
_hoisted_69$2 = { class: "row g-3" };
|
|
56254
56494
|
_hoisted_70$2 = { class: "col-md-6" };
|
|
56255
56495
|
_hoisted_71$2 = { class: "form-check" };
|
|
56256
|
-
_hoisted_72$
|
|
56496
|
+
_hoisted_72$2 = {
|
|
56257
56497
|
class: "form-check-label",
|
|
56258
56498
|
for: "syncStructure"
|
|
56259
56499
|
};
|
|
56260
|
-
_hoisted_73$
|
|
56261
|
-
_hoisted_74$
|
|
56262
|
-
_hoisted_75$
|
|
56500
|
+
_hoisted_73$2 = { class: "col-md-6" };
|
|
56501
|
+
_hoisted_74$2 = { class: "form-check" };
|
|
56502
|
+
_hoisted_75$2 = {
|
|
56263
56503
|
class: "form-check-label",
|
|
56264
56504
|
for: "syncData"
|
|
56265
56505
|
};
|
|
56266
|
-
_hoisted_76$
|
|
56267
|
-
_hoisted_77$
|
|
56268
|
-
_hoisted_78$
|
|
56506
|
+
_hoisted_76$2 = { class: "col-md-6" };
|
|
56507
|
+
_hoisted_77$2 = { class: "form-check" };
|
|
56508
|
+
_hoisted_78$2 = {
|
|
56269
56509
|
class: "form-check-label",
|
|
56270
56510
|
for: "dropIfExists"
|
|
56271
56511
|
};
|
|
56272
|
-
_hoisted_79$
|
|
56273
|
-
_hoisted_80$
|
|
56274
|
-
_hoisted_81$
|
|
56512
|
+
_hoisted_79$2 = { class: "col-md-6" };
|
|
56513
|
+
_hoisted_80$2 = { class: "form-check" };
|
|
56514
|
+
_hoisted_81$2 = {
|
|
56275
56515
|
class: "form-check-label",
|
|
56276
56516
|
for: "bulkInsert"
|
|
56277
56517
|
};
|
|
56278
|
-
_hoisted_82$
|
|
56279
|
-
_hoisted_83$
|
|
56518
|
+
_hoisted_82$2 = { class: "col-md-6" };
|
|
56519
|
+
_hoisted_83$2 = { class: "form-check" };
|
|
56280
56520
|
_hoisted_84$1 = {
|
|
56281
56521
|
class: "form-check-label",
|
|
56282
56522
|
for: "overrideExisting"
|
|
@@ -56857,19 +57097,19 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56857
57097
|
class: "btn btn-outline-secondary btn-sm",
|
|
56858
57098
|
onClick: closeTool
|
|
56859
57099
|
}, [_cache[48] || (_cache[48] = createBaseVNode("i", { class: "bi bi-x" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.closeBtn")), 1)])]), selectedTool.value === "sync" ? (openBlock(), createElementBlock("div", _hoisted_26$4, [
|
|
56860
|
-
createBaseVNode("div", _hoisted_27$4, [createBaseVNode("h6", _hoisted_28$4, [_cache[49] || (_cache[49] = createBaseVNode("i", { class: "bi bi-database" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.sourceDatabase")), 1)]), createBaseVNode("div", _hoisted_29$4, [createBaseVNode("div", _hoisted_30$
|
|
57100
|
+
createBaseVNode("div", _hoisted_27$4, [createBaseVNode("h6", _hoisted_28$4, [_cache[49] || (_cache[49] = createBaseVNode("i", { class: "bi bi-database" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.sourceDatabase")), 1)]), createBaseVNode("div", _hoisted_29$4, [createBaseVNode("div", _hoisted_30$4, [createBaseVNode("label", _hoisted_31$4, toDisplayString(_ctx.$t("dbTools.databaseNameLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
56861
57101
|
type: "text",
|
|
56862
57102
|
class: "form-control",
|
|
56863
57103
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => syncConfig.value.source.database = $event),
|
|
56864
57104
|
readonly: ""
|
|
56865
|
-
}, null, 512), [[vModelText, syncConfig.value.source.database]])]), createBaseVNode("div", _hoisted_32$
|
|
57105
|
+
}, null, 512), [[vModelText, syncConfig.value.source.database]])]), createBaseVNode("div", _hoisted_32$4, [createBaseVNode("label", _hoisted_33$4, toDisplayString(_ctx.$t("dbTools.selectTableLabel")), 1), withDirectives(createBaseVNode("select", {
|
|
56866
57106
|
class: "form-select",
|
|
56867
57107
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => syncConfig.value.source.tableName = $event)
|
|
56868
|
-
}, [createBaseVNode("option", _hoisted_34$
|
|
57108
|
+
}, [createBaseVNode("option", _hoisted_34$4, toDisplayString(_ctx.$t("dbTools.selectTablePlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(tables.value, (table) => {
|
|
56869
57109
|
return openBlock(), createElementBlock("option", {
|
|
56870
57110
|
key: table.name,
|
|
56871
57111
|
value: table.name
|
|
56872
|
-
}, toDisplayString(table.name), 9, _hoisted_35$
|
|
57112
|
+
}, toDisplayString(table.name), 9, _hoisted_35$4);
|
|
56873
57113
|
}), 128))], 512), [[vModelSelect, syncConfig.value.source.tableName]])])])]),
|
|
56874
57114
|
createBaseVNode("div", _hoisted_36$3, [
|
|
56875
57115
|
createBaseVNode("h6", _hoisted_37$3, [_cache[50] || (_cache[50] = createBaseVNode("i", { class: "bi bi-database" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.targetDatabase")), 1)]),
|
|
@@ -56889,7 +57129,7 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56889
57129
|
value: conn.id
|
|
56890
57130
|
}, toDisplayString(conn.name) + " (" + toDisplayString(conn.type) + ")", 9, _hoisted_45$3);
|
|
56891
57131
|
}), 128))], 512), [[vModelSelect, selectedConnectionId.value]])]),
|
|
56892
|
-
createBaseVNode("div", _hoisted_46$3, [createBaseVNode("label", _hoisted_47$
|
|
57132
|
+
createBaseVNode("div", _hoisted_46$3, [createBaseVNode("label", _hoisted_47$3, toDisplayString(_ctx.$t("dbTools.selectDatabaseLabel")), 1), withDirectives(createBaseVNode("select", {
|
|
56893
57133
|
class: "form-select",
|
|
56894
57134
|
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => selectedDatabaseName.value = $event)
|
|
56895
57135
|
}, [createBaseVNode("option", _hoisted_48$2, toDisplayString(_ctx.$t("dbTools.selectDatabasePlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(databases.value, (db) => {
|
|
@@ -56946,26 +57186,26 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
56946
57186
|
class: "form-check-input",
|
|
56947
57187
|
"onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => syncConfig.value.options.syncStructure = $event),
|
|
56948
57188
|
id: "syncStructure"
|
|
56949
|
-
}, null, 512), [[vModelCheckbox, syncConfig.value.options.syncStructure]]), createBaseVNode("label", _hoisted_72$
|
|
56950
|
-
createBaseVNode("div", _hoisted_73$
|
|
57189
|
+
}, null, 512), [[vModelCheckbox, syncConfig.value.options.syncStructure]]), createBaseVNode("label", _hoisted_72$2, toDisplayString(_ctx.$t("dbTools.syncStructure")), 1)])]),
|
|
57190
|
+
createBaseVNode("div", _hoisted_73$2, [createBaseVNode("div", _hoisted_74$2, [withDirectives(createBaseVNode("input", {
|
|
56951
57191
|
type: "checkbox",
|
|
56952
57192
|
class: "form-check-input",
|
|
56953
57193
|
"onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => syncConfig.value.options.syncData = $event),
|
|
56954
57194
|
id: "syncData"
|
|
56955
|
-
}, null, 512), [[vModelCheckbox, syncConfig.value.options.syncData]]), createBaseVNode("label", _hoisted_75$
|
|
56956
|
-
createBaseVNode("div", _hoisted_76$
|
|
57195
|
+
}, null, 512), [[vModelCheckbox, syncConfig.value.options.syncData]]), createBaseVNode("label", _hoisted_75$2, toDisplayString(_ctx.$t("dbTools.syncData")), 1)])]),
|
|
57196
|
+
createBaseVNode("div", _hoisted_76$2, [createBaseVNode("div", _hoisted_77$2, [withDirectives(createBaseVNode("input", {
|
|
56957
57197
|
type: "checkbox",
|
|
56958
57198
|
class: "form-check-input",
|
|
56959
57199
|
"onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => syncConfig.value.options.dropIfExists = $event),
|
|
56960
57200
|
id: "dropIfExists"
|
|
56961
|
-
}, null, 512), [[vModelCheckbox, syncConfig.value.options.dropIfExists]]), createBaseVNode("label", _hoisted_78$
|
|
56962
|
-
createBaseVNode("div", _hoisted_79$
|
|
57201
|
+
}, null, 512), [[vModelCheckbox, syncConfig.value.options.dropIfExists]]), createBaseVNode("label", _hoisted_78$2, toDisplayString(_ctx.$t("dbTools.dropIfExists")), 1)])]),
|
|
57202
|
+
createBaseVNode("div", _hoisted_79$2, [createBaseVNode("div", _hoisted_80$2, [withDirectives(createBaseVNode("input", {
|
|
56963
57203
|
type: "checkbox",
|
|
56964
57204
|
class: "form-check-input",
|
|
56965
57205
|
"onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => syncConfig.value.options.bulkInsert = $event),
|
|
56966
57206
|
id: "bulkInsert"
|
|
56967
|
-
}, null, 512), [[vModelCheckbox, syncConfig.value.options.bulkInsert]]), createBaseVNode("label", _hoisted_81$
|
|
56968
|
-
createBaseVNode("div", _hoisted_82$
|
|
57207
|
+
}, null, 512), [[vModelCheckbox, syncConfig.value.options.bulkInsert]]), createBaseVNode("label", _hoisted_81$2, toDisplayString(_ctx.$t("dbTools.bulkInsert")), 1)])]),
|
|
57208
|
+
createBaseVNode("div", _hoisted_82$2, [createBaseVNode("div", _hoisted_83$2, [withDirectives(createBaseVNode("input", {
|
|
56969
57209
|
type: "checkbox",
|
|
56970
57210
|
class: "form-check-input",
|
|
56971
57211
|
"onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => syncConfig.value.options.overrideExisting = $event),
|
|
@@ -57061,15 +57301,18 @@ var init_db_tools = __esmMin((() => {
|
|
|
57061
57301
|
}));
|
|
57062
57302
|
//#endregion
|
|
57063
57303
|
//#region src/platform/database/components/database-detail.vue?vue&type=script&setup=true&lang.ts
|
|
57064
|
-
var _hoisted_1$4, _hoisted_2$4, _hoisted_3$4, _hoisted_4$4, _hoisted_5$4, _hoisted_6$4, _hoisted_7$4, _hoisted_8$4, _hoisted_9$4, _hoisted_10$4, _hoisted_11$4, _hoisted_12$4, _hoisted_13$4, _hoisted_14$4, _hoisted_15$4, _hoisted_16$4, _hoisted_17$4, _hoisted_18$4, _hoisted_19$4, _hoisted_20$4, _hoisted_21$4, _hoisted_22$4, _hoisted_23$4, _hoisted_24$4, _hoisted_25$4, _hoisted_26$3, _hoisted_27$3, _hoisted_28$3, _hoisted_29$3, _hoisted_30$
|
|
57304
|
+
var _hoisted_1$4, _hoisted_2$4, _hoisted_3$4, _hoisted_4$4, _hoisted_5$4, _hoisted_6$4, _hoisted_7$4, _hoisted_8$4, _hoisted_9$4, _hoisted_10$4, _hoisted_11$4, _hoisted_12$4, _hoisted_13$4, _hoisted_14$4, _hoisted_15$4, _hoisted_16$4, _hoisted_17$4, _hoisted_18$4, _hoisted_19$4, _hoisted_20$4, _hoisted_21$4, _hoisted_22$4, _hoisted_23$4, _hoisted_24$4, _hoisted_25$4, _hoisted_26$3, _hoisted_27$3, _hoisted_28$3, _hoisted_29$3, _hoisted_30$3, _hoisted_31$3, _hoisted_32$3, _hoisted_33$3, _hoisted_34$3, _hoisted_35$3, _hoisted_36$2, _hoisted_37$2, _hoisted_38$2, _hoisted_39$2, _hoisted_40$2, _hoisted_41$2, _hoisted_42$2, _hoisted_43$2, _hoisted_44$2, _hoisted_45$2, _hoisted_46$2, _hoisted_47$2, _hoisted_48$1, _hoisted_49$1, _hoisted_50$1, _hoisted_51$1, _hoisted_52$1, _hoisted_53$1, _hoisted_54$1, _hoisted_55$1, _hoisted_56$1, _hoisted_57$1, _hoisted_58$1, _hoisted_59$1, _hoisted_60$1, _hoisted_61$1, _hoisted_62$1, _hoisted_63$1, _hoisted_64$1, _hoisted_65$1, _hoisted_66$1, _hoisted_67$1, _hoisted_68$1, _hoisted_69$1, _hoisted_70$1, _hoisted_71$1, _hoisted_72$1, _hoisted_73$1, _hoisted_74$1, _hoisted_75$1, _hoisted_76$1, _hoisted_77$1, _hoisted_78$1, _hoisted_79$1, _hoisted_80$1, _hoisted_81$1, _hoisted_82$1, _hoisted_83$1, _hoisted_84, _hoisted_85, _hoisted_86, _hoisted_87, _hoisted_88, _hoisted_89, _hoisted_90, _hoisted_91, _hoisted_92, _hoisted_93, _hoisted_94, _hoisted_95, _hoisted_96, _hoisted_97, _hoisted_98, _hoisted_99, _hoisted_100, _hoisted_101, _hoisted_102, _hoisted_103, _hoisted_104, _hoisted_105, _hoisted_106, _hoisted_107, _hoisted_108, _hoisted_109, _hoisted_110, _hoisted_111, _hoisted_112, _hoisted_113, _hoisted_114, _hoisted_115, _hoisted_116, _hoisted_117, _hoisted_118, _hoisted_119, _hoisted_120, _hoisted_121, _hoisted_122, _hoisted_123, _hoisted_124, _hoisted_125, _hoisted_126, _hoisted_127, _hoisted_128, _hoisted_129, database_detail_vue_vue_type_script_setup_true_lang_default;
|
|
57065
57305
|
var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
57066
57306
|
init_vue_runtime_esm_bundler();
|
|
57067
57307
|
init_vue_i18n();
|
|
57068
57308
|
init_table_editor();
|
|
57069
57309
|
init_sql_executor();
|
|
57310
|
+
init_document_query_panel();
|
|
57070
57311
|
init_db_tools();
|
|
57071
57312
|
init_modal();
|
|
57313
|
+
init_toast();
|
|
57072
57314
|
init_database();
|
|
57315
|
+
init_database_types$1();
|
|
57073
57316
|
_hoisted_1$4 = { class: "database-detail" };
|
|
57074
57317
|
_hoisted_2$4 = { class: "database-header" };
|
|
57075
57318
|
_hoisted_3$4 = { class: "database-header-content" };
|
|
@@ -57090,161 +57333,181 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57090
57333
|
_hoisted_18$4 = { class: "database-tabs" };
|
|
57091
57334
|
_hoisted_19$4 = { class: "nav nav-tabs" };
|
|
57092
57335
|
_hoisted_20$4 = { class: "nav-item" };
|
|
57093
|
-
_hoisted_21$4 = {
|
|
57094
|
-
_hoisted_22$4 = { class: "nav-item" };
|
|
57095
|
-
_hoisted_23$4 = { class: "nav-item" };
|
|
57096
|
-
_hoisted_24$4 = { class: "nav-item" };
|
|
57097
|
-
_hoisted_25$4 = { class: "tab-content" };
|
|
57098
|
-
_hoisted_26$3 = { class: "tab-panel" };
|
|
57099
|
-
_hoisted_27$3 = { class: "tables-actions mb-3" };
|
|
57100
|
-
_hoisted_28$3 = {
|
|
57336
|
+
_hoisted_21$4 = {
|
|
57101
57337
|
key: 0,
|
|
57102
|
-
class: "
|
|
57338
|
+
class: "nav-item"
|
|
57103
57339
|
};
|
|
57340
|
+
_hoisted_22$4 = {
|
|
57341
|
+
key: 1,
|
|
57342
|
+
class: "nav-item"
|
|
57343
|
+
};
|
|
57344
|
+
_hoisted_23$4 = {
|
|
57345
|
+
key: 2,
|
|
57346
|
+
class: "nav-item"
|
|
57347
|
+
};
|
|
57348
|
+
_hoisted_24$4 = {
|
|
57349
|
+
key: 3,
|
|
57350
|
+
class: "nav-item"
|
|
57351
|
+
};
|
|
57352
|
+
_hoisted_25$4 = { class: "nav-item" };
|
|
57353
|
+
_hoisted_26$3 = { class: "tab-content" };
|
|
57354
|
+
_hoisted_27$3 = { class: "tab-panel" };
|
|
57355
|
+
_hoisted_28$3 = { class: "tables-actions mb-3" };
|
|
57104
57356
|
_hoisted_29$3 = {
|
|
57357
|
+
key: 0,
|
|
57358
|
+
class: "loading-state"
|
|
57359
|
+
};
|
|
57360
|
+
_hoisted_30$3 = {
|
|
57105
57361
|
class: "spinner-border",
|
|
57106
57362
|
role: "status"
|
|
57107
57363
|
};
|
|
57108
|
-
|
|
57109
|
-
|
|
57110
|
-
|
|
57111
|
-
|
|
57112
|
-
|
|
57113
|
-
|
|
57114
|
-
|
|
57115
|
-
|
|
57116
|
-
|
|
57117
|
-
|
|
57118
|
-
|
|
57119
|
-
|
|
57120
|
-
|
|
57121
|
-
|
|
57122
|
-
|
|
57364
|
+
_hoisted_31$3 = { class: "visually-hidden" };
|
|
57365
|
+
_hoisted_32$3 = { key: 1 };
|
|
57366
|
+
_hoisted_33$3 = { class: "table-grid" };
|
|
57367
|
+
_hoisted_34$3 = ["onClick"];
|
|
57368
|
+
_hoisted_35$3 = { class: "card-header" };
|
|
57369
|
+
_hoisted_36$2 = { class: "table-info" };
|
|
57370
|
+
_hoisted_37$2 = { class: "table-name-wrapper" };
|
|
57371
|
+
_hoisted_38$2 = ["title"];
|
|
57372
|
+
_hoisted_39$2 = { class: "table-engine" };
|
|
57373
|
+
_hoisted_40$2 = ["title"];
|
|
57374
|
+
_hoisted_41$2 = { class: "table-actions" };
|
|
57375
|
+
_hoisted_42$2 = ["onClick", "title"];
|
|
57376
|
+
_hoisted_43$2 = { class: "card-body" };
|
|
57377
|
+
_hoisted_44$2 = { class: "table-stats" };
|
|
57378
|
+
_hoisted_45$2 = {
|
|
57123
57379
|
key: 0,
|
|
57124
57380
|
class: "stat"
|
|
57125
57381
|
};
|
|
57126
|
-
|
|
57127
|
-
|
|
57128
|
-
|
|
57382
|
+
_hoisted_46$2 = { class: "stat-label" };
|
|
57383
|
+
_hoisted_47$2 = { class: "stat-value" };
|
|
57384
|
+
_hoisted_48$1 = {
|
|
57129
57385
|
key: 1,
|
|
57130
57386
|
class: "stat"
|
|
57131
57387
|
};
|
|
57132
|
-
|
|
57133
|
-
|
|
57134
|
-
|
|
57388
|
+
_hoisted_49$1 = { class: "stat-label" };
|
|
57389
|
+
_hoisted_50$1 = { class: "stat-value" };
|
|
57390
|
+
_hoisted_51$1 = {
|
|
57135
57391
|
key: 0,
|
|
57136
57392
|
class: "empty-state"
|
|
57137
57393
|
};
|
|
57138
|
-
|
|
57139
|
-
|
|
57140
|
-
|
|
57394
|
+
_hoisted_52$1 = { class: "tab-panel" };
|
|
57395
|
+
_hoisted_53$1 = { class: "views-actions mb-3" };
|
|
57396
|
+
_hoisted_54$1 = {
|
|
57141
57397
|
key: 0,
|
|
57142
57398
|
class: "views-grid"
|
|
57143
57399
|
};
|
|
57144
|
-
|
|
57145
|
-
|
|
57146
|
-
|
|
57147
|
-
|
|
57400
|
+
_hoisted_55$1 = { class: "card-header" };
|
|
57401
|
+
_hoisted_56$1 = { class: "view-info" };
|
|
57402
|
+
_hoisted_57$1 = { class: "view-name" };
|
|
57403
|
+
_hoisted_58$1 = {
|
|
57148
57404
|
key: 0,
|
|
57149
57405
|
class: "view-comment"
|
|
57150
57406
|
};
|
|
57151
|
-
|
|
57152
|
-
|
|
57153
|
-
_hoisted_60$1 = ["onClick"];
|
|
57407
|
+
_hoisted_59$1 = { class: "card-body" };
|
|
57408
|
+
_hoisted_60$1 = { class: "view-actions" };
|
|
57154
57409
|
_hoisted_61$1 = ["onClick"];
|
|
57155
|
-
_hoisted_62$1 =
|
|
57410
|
+
_hoisted_62$1 = ["onClick"];
|
|
57411
|
+
_hoisted_63$1 = {
|
|
57156
57412
|
key: 1,
|
|
57157
57413
|
class: "empty-state"
|
|
57158
57414
|
};
|
|
57159
|
-
|
|
57160
|
-
|
|
57161
|
-
|
|
57415
|
+
_hoisted_64$1 = { class: "tab-panel" };
|
|
57416
|
+
_hoisted_65$1 = { class: "procedures-actions mb-3" };
|
|
57417
|
+
_hoisted_66$1 = {
|
|
57162
57418
|
key: 0,
|
|
57163
57419
|
class: "procedures-grid"
|
|
57164
57420
|
};
|
|
57165
|
-
|
|
57166
|
-
|
|
57167
|
-
|
|
57168
|
-
|
|
57421
|
+
_hoisted_67$1 = { class: "card-header" };
|
|
57422
|
+
_hoisted_68$1 = { class: "procedure-info" };
|
|
57423
|
+
_hoisted_69$1 = { class: "procedure-name" };
|
|
57424
|
+
_hoisted_70$1 = {
|
|
57169
57425
|
key: 0,
|
|
57170
57426
|
class: "procedure-comment"
|
|
57171
57427
|
};
|
|
57172
|
-
|
|
57173
|
-
|
|
57174
|
-
|
|
57428
|
+
_hoisted_71$1 = { class: "procedure-type" };
|
|
57429
|
+
_hoisted_72$1 = { class: "badge bg-info" };
|
|
57430
|
+
_hoisted_73$1 = {
|
|
57175
57431
|
key: 0,
|
|
57176
57432
|
class: "badge bg-secondary ms-1"
|
|
57177
57433
|
};
|
|
57178
|
-
|
|
57179
|
-
|
|
57180
|
-
|
|
57181
|
-
|
|
57182
|
-
|
|
57434
|
+
_hoisted_74$1 = { class: "card-body" };
|
|
57435
|
+
_hoisted_75$1 = { class: "procedure-actions" };
|
|
57436
|
+
_hoisted_76$1 = ["onClick"];
|
|
57437
|
+
_hoisted_77$1 = ["onClick"];
|
|
57438
|
+
_hoisted_78$1 = {
|
|
57183
57439
|
key: 1,
|
|
57184
57440
|
class: "empty-state"
|
|
57185
57441
|
};
|
|
57186
|
-
|
|
57187
|
-
|
|
57188
|
-
|
|
57189
|
-
|
|
57190
|
-
|
|
57191
|
-
|
|
57442
|
+
_hoisted_79$1 = { class: "tab-panel" };
|
|
57443
|
+
_hoisted_80$1 = { class: "empty-state" };
|
|
57444
|
+
_hoisted_81$1 = {
|
|
57445
|
+
key: 0,
|
|
57446
|
+
class: "tab-panel"
|
|
57447
|
+
};
|
|
57448
|
+
_hoisted_82$1 = { class: "sql-executor-section" };
|
|
57449
|
+
_hoisted_83$1 = {
|
|
57450
|
+
key: 1,
|
|
57451
|
+
class: "tab-panel"
|
|
57452
|
+
};
|
|
57453
|
+
_hoisted_84 = { class: "tab-panel" };
|
|
57454
|
+
_hoisted_85 = {
|
|
57192
57455
|
key: 0,
|
|
57193
57456
|
class: "modal fade show d-block",
|
|
57194
57457
|
style: { "background": "rgba(0,0,0,0.5)" }
|
|
57195
57458
|
};
|
|
57196
|
-
|
|
57197
|
-
|
|
57198
|
-
|
|
57199
|
-
|
|
57200
|
-
|
|
57201
|
-
|
|
57202
|
-
|
|
57203
|
-
|
|
57204
|
-
|
|
57205
|
-
|
|
57206
|
-
|
|
57207
|
-
|
|
57208
|
-
|
|
57459
|
+
_hoisted_86 = { class: "modal-dialog modal-lg" };
|
|
57460
|
+
_hoisted_87 = { class: "modal-content" };
|
|
57461
|
+
_hoisted_88 = { class: "modal-header" };
|
|
57462
|
+
_hoisted_89 = { class: "modal-title" };
|
|
57463
|
+
_hoisted_90 = { class: "modal-body" };
|
|
57464
|
+
_hoisted_91 = { class: "mb-3" };
|
|
57465
|
+
_hoisted_92 = { class: "form-label" };
|
|
57466
|
+
_hoisted_93 = ["placeholder"];
|
|
57467
|
+
_hoisted_94 = { class: "mb-3" };
|
|
57468
|
+
_hoisted_95 = { class: "form-label" };
|
|
57469
|
+
_hoisted_96 = ["placeholder"];
|
|
57470
|
+
_hoisted_97 = { class: "modal-footer" };
|
|
57471
|
+
_hoisted_98 = {
|
|
57209
57472
|
key: 1,
|
|
57210
57473
|
class: "modal fade show d-block",
|
|
57211
57474
|
style: { "background": "rgba(0,0,0,0.5)" }
|
|
57212
57475
|
};
|
|
57213
|
-
|
|
57214
|
-
|
|
57215
|
-
|
|
57216
|
-
|
|
57217
|
-
|
|
57218
|
-
|
|
57219
|
-
|
|
57220
|
-
|
|
57221
|
-
|
|
57222
|
-
|
|
57223
|
-
|
|
57224
|
-
|
|
57225
|
-
|
|
57226
|
-
|
|
57227
|
-
|
|
57228
|
-
|
|
57476
|
+
_hoisted_99 = { class: "modal-dialog modal-lg" };
|
|
57477
|
+
_hoisted_100 = { class: "modal-content" };
|
|
57478
|
+
_hoisted_101 = { class: "modal-header" };
|
|
57479
|
+
_hoisted_102 = { class: "modal-title" };
|
|
57480
|
+
_hoisted_103 = { class: "modal-body" };
|
|
57481
|
+
_hoisted_104 = { class: "mb-3" };
|
|
57482
|
+
_hoisted_105 = { class: "form-label" };
|
|
57483
|
+
_hoisted_106 = ["placeholder"];
|
|
57484
|
+
_hoisted_107 = { class: "mb-3" };
|
|
57485
|
+
_hoisted_108 = { class: "form-label" };
|
|
57486
|
+
_hoisted_109 = ["placeholder"];
|
|
57487
|
+
_hoisted_110 = { class: "mb-3" };
|
|
57488
|
+
_hoisted_111 = { class: "form-label" };
|
|
57489
|
+
_hoisted_112 = ["placeholder"];
|
|
57490
|
+
_hoisted_113 = { class: "modal-footer" };
|
|
57491
|
+
_hoisted_114 = {
|
|
57229
57492
|
key: 2,
|
|
57230
57493
|
class: "modal fade show d-block",
|
|
57231
57494
|
style: { "background": "rgba(0,0,0,0.5)" }
|
|
57232
57495
|
};
|
|
57233
|
-
|
|
57234
|
-
|
|
57235
|
-
|
|
57236
|
-
|
|
57237
|
-
|
|
57238
|
-
|
|
57239
|
-
|
|
57240
|
-
|
|
57241
|
-
|
|
57242
|
-
|
|
57243
|
-
|
|
57244
|
-
|
|
57245
|
-
|
|
57246
|
-
|
|
57247
|
-
|
|
57496
|
+
_hoisted_115 = { class: "modal-dialog modal-lg" };
|
|
57497
|
+
_hoisted_116 = { class: "modal-content" };
|
|
57498
|
+
_hoisted_117 = { class: "modal-header" };
|
|
57499
|
+
_hoisted_118 = { class: "modal-title" };
|
|
57500
|
+
_hoisted_119 = { class: "modal-body" };
|
|
57501
|
+
_hoisted_120 = { class: "mb-3" };
|
|
57502
|
+
_hoisted_121 = { class: "form-label" };
|
|
57503
|
+
_hoisted_122 = ["placeholder"];
|
|
57504
|
+
_hoisted_123 = { class: "mb-3" };
|
|
57505
|
+
_hoisted_124 = { class: "form-label" };
|
|
57506
|
+
_hoisted_125 = ["placeholder"];
|
|
57507
|
+
_hoisted_126 = { class: "mb-3" };
|
|
57508
|
+
_hoisted_127 = { class: "form-label" };
|
|
57509
|
+
_hoisted_128 = ["placeholder"];
|
|
57510
|
+
_hoisted_129 = { class: "modal-footer" };
|
|
57248
57511
|
database_detail_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
57249
57512
|
__name: "database-detail",
|
|
57250
57513
|
props: {
|
|
@@ -57266,6 +57529,8 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57266
57529
|
const emit = __emit;
|
|
57267
57530
|
const databaseService = new DatabaseService();
|
|
57268
57531
|
const { t } = useI18n();
|
|
57532
|
+
const isDocDb = computed(() => isDocumentDb(props.connection?.type));
|
|
57533
|
+
computed(() => nounOf(props.connection?.type, "table"));
|
|
57269
57534
|
const activeTab = ref("tables");
|
|
57270
57535
|
const showCreateTable = ref(false);
|
|
57271
57536
|
const showCreateView = ref(false);
|
|
@@ -57432,7 +57697,7 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57432
57697
|
if (views.value.some((v) => v.name === editingView.value.name)) await databaseService.dropView(props.connection?.id || "", props.database, editingView.value.name);
|
|
57433
57698
|
const result = await databaseService.createView(props.connection?.id || "", props.database, editingView.value.name, definition);
|
|
57434
57699
|
if (result.success || result.ret === 0) {
|
|
57435
|
-
|
|
57700
|
+
toast.success(t("databaseDetail.viewSaveSuccess"));
|
|
57436
57701
|
showCreateView.value = false;
|
|
57437
57702
|
editingView.value = null;
|
|
57438
57703
|
await loadViews();
|
|
@@ -57440,14 +57705,14 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57440
57705
|
} catch (error) {
|
|
57441
57706
|
console.error("保存视图失败:", error);
|
|
57442
57707
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
57443
|
-
modal.error(errorMsg || "
|
|
57708
|
+
modal.error(errorMsg || t("databaseDetail.viewSaveFailed"));
|
|
57444
57709
|
}
|
|
57445
57710
|
}
|
|
57446
57711
|
async function deleteView(view) {
|
|
57447
57712
|
if (await modal.confirm(t("databaseDetail.confirmDeleteView", { name: view.name }))) try {
|
|
57448
57713
|
const response = await databaseService.dropView(props.connection?.id || "", props.database, view.name);
|
|
57449
57714
|
if (response.success || response.ok) {
|
|
57450
|
-
|
|
57715
|
+
toast.success(t("databaseDetail.viewDeleteSuccess"));
|
|
57451
57716
|
await loadViews();
|
|
57452
57717
|
} else await modal.error(t("databaseDetail.viewDeleteFailed"));
|
|
57453
57718
|
} catch (error) {
|
|
@@ -57501,7 +57766,7 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57501
57766
|
if (procedures.value.some((p) => p.name === editingProcedure.value.name)) await databaseService.dropProcedure(props.connection?.id || "", props.database, editingProcedure.value.name);
|
|
57502
57767
|
const result = await databaseService.createProcedure(props.connection?.id || "", props.database, editingProcedure.value.name, editingProcedure.value.definition);
|
|
57503
57768
|
if (result.success || result.ret === 0) {
|
|
57504
|
-
|
|
57769
|
+
toast.success(t("databaseDetail.procedureSaveSuccess"));
|
|
57505
57770
|
showCreateProcedure.value = false;
|
|
57506
57771
|
editingProcedure.value = null;
|
|
57507
57772
|
await loadProcedures();
|
|
@@ -57509,14 +57774,14 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57509
57774
|
} catch (error) {
|
|
57510
57775
|
console.error("保存存储过程失败:", error);
|
|
57511
57776
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
57512
|
-
modal.error(errorMsg || "
|
|
57777
|
+
modal.error(errorMsg || t("databaseDetail.procedureSaveFailed"));
|
|
57513
57778
|
}
|
|
57514
57779
|
}
|
|
57515
57780
|
async function deleteProcedure(procedure) {
|
|
57516
57781
|
if (await modal.confirm(t("databaseDetail.confirmDeleteProcedure", { name: procedure.name }))) try {
|
|
57517
57782
|
const response = await databaseService.dropProcedure(props.connection?.id || "", props.database, procedure.name);
|
|
57518
57783
|
if (response.success || response.ok) {
|
|
57519
|
-
|
|
57784
|
+
toast.success(t("databaseDetail.procedureDeleteSuccess"));
|
|
57520
57785
|
await loadProcedures();
|
|
57521
57786
|
} else await modal.error(t("databaseDetail.procedureDeleteFailed"));
|
|
57522
57787
|
} catch (error) {
|
|
@@ -57530,7 +57795,7 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57530
57795
|
if (result.success) {
|
|
57531
57796
|
emit("refresh-database");
|
|
57532
57797
|
const successMessage = isCreate ? t("databaseDetail.tableCreateSuccess") : t("databaseDetail.tableModifySuccess");
|
|
57533
|
-
|
|
57798
|
+
toast.success(successMessage);
|
|
57534
57799
|
} else {
|
|
57535
57800
|
const errorMessage = isCreate ? t("databaseDetail.tableCreateFailed") : t("databaseDetail.tableModifyFailed");
|
|
57536
57801
|
await modal.error(errorMessage);
|
|
@@ -57550,13 +57815,13 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57550
57815
|
}
|
|
57551
57816
|
return (_ctx, _cache) => {
|
|
57552
57817
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
57553
|
-
createBaseVNode("div", _hoisted_2$4, [createBaseVNode("div", _hoisted_3$4, [createBaseVNode("div", _hoisted_4$4, [_cache[
|
|
57818
|
+
createBaseVNode("div", _hoisted_2$4, [createBaseVNode("div", _hoisted_3$4, [createBaseVNode("div", _hoisted_4$4, [_cache[23] || (_cache[23] = createBaseVNode("div", { class: "database-icon" }, [createBaseVNode("i", { class: "bi bi-database" })], -1)), createBaseVNode("div", _hoisted_5$4, [createBaseVNode("h4", _hoisted_6$4, toDisplayString(__props.database), 1), createBaseVNode("div", _hoisted_7$4, [
|
|
57554
57819
|
createBaseVNode("span", {
|
|
57555
57820
|
class: "crumb crumb-link",
|
|
57556
57821
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("navigate-connection")),
|
|
57557
57822
|
title: _ctx.$t("databaseDetail.backToConnection")
|
|
57558
|
-
}, [_cache[
|
|
57559
|
-
_cache[
|
|
57823
|
+
}, [_cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-hdd-network me-1" }, null, -1)), createTextVNode(toDisplayString(__props.connection?.name), 1)], 8, _hoisted_8$4),
|
|
57824
|
+
_cache[22] || (_cache[22] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
|
|
57560
57825
|
createBaseVNode("span", _hoisted_9$4, toDisplayString(__props.database), 1),
|
|
57561
57826
|
createBaseVNode("span", _hoisted_10$4, toDisplayString(getDbTypeLabel(__props.connection?.type)), 1)
|
|
57562
57827
|
])])]), createBaseVNode("div", _hoisted_11$4, [createBaseVNode("div", _hoisted_12$4, [createBaseVNode("div", _hoisted_13$4, toDisplayString((tables.value || []).length), 1), createBaseVNode("div", _hoisted_14$4, toDisplayString(_ctx.$t("connection.tableCount")), 1)]), createBaseVNode("div", _hoisted_15$4, [createBaseVNode("div", _hoisted_16$4, toDisplayString(formatSize(__props.databaseInfo?.size || 0)), 1), createBaseVNode("div", _hoisted_17$4, toDisplayString(_ctx.$t("databaseDetail.size")), 1)])])])]),
|
|
@@ -57564,216 +57829,229 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57564
57829
|
createBaseVNode("li", _hoisted_20$4, [createBaseVNode("button", {
|
|
57565
57830
|
class: normalizeClass(["nav-link", { active: activeTab.value === "tables" }]),
|
|
57566
57831
|
onClick: _cache[1] || (_cache[1] = ($event) => activeTab.value = "tables")
|
|
57567
|
-
}, [_cache[
|
|
57568
|
-
|
|
57832
|
+
}, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-table" }, null, -1)), createTextVNode(" " + toDisplayString(isDocDb.value ? _ctx.$t("databaseDetail.collections") : _ctx.$t("databaseDetail.tables")), 1)], 2)]),
|
|
57833
|
+
!isDocDb.value ? (openBlock(), createElementBlock("li", _hoisted_21$4, [createBaseVNode("button", {
|
|
57569
57834
|
class: normalizeClass(["nav-link", { active: activeTab.value === "views" }]),
|
|
57570
57835
|
onClick: _cache[2] || (_cache[2] = ($event) => activeTab.value = "views")
|
|
57571
|
-
}, [_cache[
|
|
57572
|
-
|
|
57836
|
+
}, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-eye" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.views")), 1)], 2)])) : createCommentVNode("", true),
|
|
57837
|
+
!isDocDb.value ? (openBlock(), createElementBlock("li", _hoisted_22$4, [createBaseVNode("button", {
|
|
57573
57838
|
class: normalizeClass(["nav-link", { active: activeTab.value === "procedures" }]),
|
|
57574
57839
|
onClick: _cache[3] || (_cache[3] = ($event) => activeTab.value = "procedures")
|
|
57575
|
-
}, [_cache[
|
|
57576
|
-
|
|
57840
|
+
}, [_cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-gear" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.procedures")), 1)], 2)])) : createCommentVNode("", true),
|
|
57841
|
+
!isDocDb.value ? (openBlock(), createElementBlock("li", _hoisted_23$4, [createBaseVNode("button", {
|
|
57577
57842
|
class: normalizeClass(["nav-link", { active: activeTab.value === "sql" }]),
|
|
57578
57843
|
onClick: _cache[4] || (_cache[4] = ($event) => activeTab.value = "sql")
|
|
57579
|
-
}, [_cache[
|
|
57580
|
-
|
|
57844
|
+
}, [_cache[27] || (_cache[27] = createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.executeSQL")), 1)], 2)])) : createCommentVNode("", true),
|
|
57845
|
+
isDocDb.value ? (openBlock(), createElementBlock("li", _hoisted_24$4, [createBaseVNode("button", {
|
|
57846
|
+
class: normalizeClass(["nav-link", { active: activeTab.value === "docQuery" }]),
|
|
57847
|
+
onClick: _cache[5] || (_cache[5] = ($event) => activeTab.value = "docQuery")
|
|
57848
|
+
}, [..._cache[28] || (_cache[28] = [createBaseVNode("i", { class: "bi bi-braces" }, null, -1), createTextVNode(" 文档查询 ", -1)])], 2)])) : createCommentVNode("", true),
|
|
57849
|
+
createBaseVNode("li", _hoisted_25$4, [createBaseVNode("button", {
|
|
57581
57850
|
class: normalizeClass(["nav-link", { active: activeTab.value === "tools" }]),
|
|
57582
|
-
onClick: _cache[
|
|
57583
|
-
}, [_cache[
|
|
57584
|
-
]), createBaseVNode("div",
|
|
57585
|
-
withDirectives(createBaseVNode("div",
|
|
57851
|
+
onClick: _cache[6] || (_cache[6] = ($event) => activeTab.value = "tools")
|
|
57852
|
+
}, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-tools" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.tools")), 1)], 2)])
|
|
57853
|
+
]), createBaseVNode("div", _hoisted_26$3, [
|
|
57854
|
+
withDirectives(createBaseVNode("div", _hoisted_27$3, [createBaseVNode("div", _hoisted_28$3, [createBaseVNode("button", {
|
|
57586
57855
|
class: "btn btn-primary btn-sm",
|
|
57587
57856
|
onClick: createNewTable
|
|
57588
|
-
}, [_cache[
|
|
57857
|
+
}, [_cache[30] || (_cache[30] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createTable")), 1)]), createBaseVNode("button", {
|
|
57589
57858
|
class: "btn btn-outline-secondary btn-sm",
|
|
57590
57859
|
onClick: handleRefreshDatabase
|
|
57591
|
-
}, [_cache[
|
|
57860
|
+
}, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), __props.loading ? (openBlock(), createElementBlock("div", _hoisted_29$3, [createBaseVNode("div", _hoisted_30$3, [createBaseVNode("span", _hoisted_31$3, toDisplayString(_ctx.$t("common.loading")), 1)]), createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.loadingTables")), 1)])) : (openBlock(), createElementBlock("div", _hoisted_32$3, [createBaseVNode("div", _hoisted_33$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(tables.value, (table) => {
|
|
57592
57861
|
return openBlock(), createElementBlock("div", {
|
|
57593
57862
|
key: table.name,
|
|
57594
57863
|
class: "table-card",
|
|
57595
57864
|
onClick: ($event) => selectTable(table)
|
|
57596
|
-
}, [createBaseVNode("div",
|
|
57597
|
-
_cache[
|
|
57598
|
-
createBaseVNode("div",
|
|
57865
|
+
}, [createBaseVNode("div", _hoisted_35$3, [
|
|
57866
|
+
_cache[33] || (_cache[33] = createBaseVNode("div", { class: "table-icon" }, [createBaseVNode("i", { class: "bi bi-table" })], -1)),
|
|
57867
|
+
createBaseVNode("div", _hoisted_36$2, [createBaseVNode("div", _hoisted_37$2, [createBaseVNode("div", {
|
|
57599
57868
|
class: "table-name",
|
|
57600
57869
|
title: table.name
|
|
57601
|
-
}, toDisplayString(table.name), 9,
|
|
57870
|
+
}, toDisplayString(table.name), 9, _hoisted_38$2), createBaseVNode("div", _hoisted_39$2, toDisplayString(table.engine || "-"), 1)]), table.comment ? (openBlock(), createElementBlock("div", {
|
|
57602
57871
|
key: 0,
|
|
57603
57872
|
class: "table-comment-header",
|
|
57604
57873
|
title: table.comment
|
|
57605
|
-
}, toDisplayString(table.comment), 9,
|
|
57606
|
-
createBaseVNode("div",
|
|
57874
|
+
}, toDisplayString(table.comment), 9, _hoisted_40$2)) : createCommentVNode("", true)]),
|
|
57875
|
+
createBaseVNode("div", _hoisted_41$2, [createBaseVNode("button", {
|
|
57607
57876
|
class: "btn btn-sm btn-outline-primary",
|
|
57608
57877
|
onClick: withModifiers(($event) => editTable(table), ["stop"]),
|
|
57609
57878
|
title: _ctx.$t("common.edit")
|
|
57610
|
-
}, [..._cache[
|
|
57611
|
-
]), createBaseVNode("div",
|
|
57612
|
-
}), 128))]), !tables.value || tables.value.length === 0 ? (openBlock(), createElementBlock("div",
|
|
57613
|
-
_cache[
|
|
57879
|
+
}, [..._cache[32] || (_cache[32] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_42$2)])
|
|
57880
|
+
]), createBaseVNode("div", _hoisted_43$2, [createBaseVNode("div", _hoisted_44$2, [table.rowCount !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_45$2, [createBaseVNode("span", _hoisted_46$2, toDisplayString(_ctx.$t("databaseDetail.rowCountLabel")), 1), createBaseVNode("span", _hoisted_47$2, toDisplayString(formatNumber(table.rowCount)), 1)])) : createCommentVNode("", true), table.dataSize !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_48$1, [createBaseVNode("span", _hoisted_49$1, toDisplayString(_ctx.$t("databaseDetail.size")), 1), createBaseVNode("span", _hoisted_50$1, toDisplayString(formatSize(table.dataSize)), 1)])) : createCommentVNode("", true)])])], 8, _hoisted_34$3);
|
|
57881
|
+
}), 128))]), !tables.value || tables.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_51$1, [
|
|
57882
|
+
_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-inbox" }, null, -1)),
|
|
57614
57883
|
createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.noTable")), 1),
|
|
57615
57884
|
createBaseVNode("button", {
|
|
57616
57885
|
class: "btn btn-primary",
|
|
57617
57886
|
onClick: createNewTable
|
|
57618
|
-
}, [_cache[
|
|
57887
|
+
}, [_cache[34] || (_cache[34] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createTable")), 1)])
|
|
57619
57888
|
])) : createCommentVNode("", true)]))], 512), [[vShow, activeTab.value === "tables"]]),
|
|
57620
|
-
withDirectives(createBaseVNode("div",
|
|
57889
|
+
withDirectives(createBaseVNode("div", _hoisted_52$1, [createBaseVNode("div", _hoisted_53$1, [createBaseVNode("button", {
|
|
57621
57890
|
class: "btn btn-success btn-sm",
|
|
57622
57891
|
onClick: showCreateViewModal
|
|
57623
|
-
}, [_cache[
|
|
57892
|
+
}, [_cache[36] || (_cache[36] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createView")), 1)]), createBaseVNode("button", {
|
|
57624
57893
|
class: "btn btn-info btn-sm",
|
|
57625
57894
|
onClick: refreshViews
|
|
57626
|
-
}, [_cache[
|
|
57895
|
+
}, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), views.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_54$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(views.value, (view) => {
|
|
57627
57896
|
return openBlock(), createElementBlock("div", {
|
|
57628
57897
|
key: view.name,
|
|
57629
57898
|
class: "view-card"
|
|
57630
|
-
}, [createBaseVNode("div",
|
|
57899
|
+
}, [createBaseVNode("div", _hoisted_55$1, [_cache[38] || (_cache[38] = createBaseVNode("div", { class: "view-icon" }, [createBaseVNode("i", { class: "bi bi-eye" })], -1)), createBaseVNode("div", _hoisted_56$1, [createBaseVNode("div", _hoisted_57$1, toDisplayString(view.name), 1), view.comment ? (openBlock(), createElementBlock("div", _hoisted_58$1, toDisplayString(view.comment), 1)) : createCommentVNode("", true)])]), createBaseVNode("div", _hoisted_59$1, [createBaseVNode("div", _hoisted_60$1, [createBaseVNode("button", {
|
|
57631
57900
|
class: "btn btn-sm btn-outline-primary",
|
|
57632
57901
|
onClick: ($event) => editView(view)
|
|
57633
|
-
}, [_cache[
|
|
57902
|
+
}, [_cache[39] || (_cache[39] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)], 8, _hoisted_61$1), createBaseVNode("button", {
|
|
57634
57903
|
class: "btn btn-sm btn-outline-danger",
|
|
57635
57904
|
onClick: ($event) => deleteView(view)
|
|
57636
|
-
}, [_cache[
|
|
57637
|
-
}), 128))])) : (openBlock(), createElementBlock("div",
|
|
57638
|
-
_cache[
|
|
57905
|
+
}, [_cache[40] || (_cache[40] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.delete")), 1)], 8, _hoisted_62$1)])])]);
|
|
57906
|
+
}), 128))])) : (openBlock(), createElementBlock("div", _hoisted_63$1, [
|
|
57907
|
+
_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-eye" }, null, -1)),
|
|
57639
57908
|
createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.noView")), 1),
|
|
57640
57909
|
createBaseVNode("button", {
|
|
57641
57910
|
class: "btn btn-success",
|
|
57642
57911
|
onClick: showCreateViewModal
|
|
57643
|
-
}, [_cache[
|
|
57912
|
+
}, [_cache[41] || (_cache[41] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createView")), 1)])
|
|
57644
57913
|
]))], 512), [[vShow, activeTab.value === "views"]]),
|
|
57645
|
-
withDirectives(createBaseVNode("div",
|
|
57914
|
+
withDirectives(createBaseVNode("div", _hoisted_64$1, [createBaseVNode("div", _hoisted_65$1, [createBaseVNode("button", {
|
|
57646
57915
|
class: "btn btn-info btn-sm",
|
|
57647
57916
|
onClick: showCreateProcedureModal
|
|
57648
|
-
}, [_cache[
|
|
57917
|
+
}, [_cache[43] || (_cache[43] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createProcedure")), 1)]), createBaseVNode("button", {
|
|
57649
57918
|
class: "btn btn-info btn-sm",
|
|
57650
57919
|
onClick: refreshProcedures
|
|
57651
|
-
}, [_cache[
|
|
57920
|
+
}, [_cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), procedures.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_66$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(procedures.value, (procedure) => {
|
|
57652
57921
|
return openBlock(), createElementBlock("div", {
|
|
57653
57922
|
key: procedure.name,
|
|
57654
57923
|
class: "procedure-card"
|
|
57655
|
-
}, [createBaseVNode("div",
|
|
57656
|
-
createBaseVNode("div",
|
|
57657
|
-
procedure.comment ? (openBlock(), createElementBlock("div",
|
|
57658
|
-
createBaseVNode("div",
|
|
57659
|
-
])]), createBaseVNode("div",
|
|
57924
|
+
}, [createBaseVNode("div", _hoisted_67$1, [_cache[45] || (_cache[45] = createBaseVNode("div", { class: "procedure-icon" }, [createBaseVNode("i", { class: "bi bi-gear" })], -1)), createBaseVNode("div", _hoisted_68$1, [
|
|
57925
|
+
createBaseVNode("div", _hoisted_69$1, toDisplayString(procedure.name), 1),
|
|
57926
|
+
procedure.comment ? (openBlock(), createElementBlock("div", _hoisted_70$1, toDisplayString(procedure.comment), 1)) : createCommentVNode("", true),
|
|
57927
|
+
createBaseVNode("div", _hoisted_71$1, [createBaseVNode("span", _hoisted_72$1, toDisplayString(procedure.type), 1), procedure.returnType ? (openBlock(), createElementBlock("span", _hoisted_73$1, toDisplayString(procedure.returnType), 1)) : createCommentVNode("", true)])
|
|
57928
|
+
])]), createBaseVNode("div", _hoisted_74$1, [createBaseVNode("div", _hoisted_75$1, [createBaseVNode("button", {
|
|
57660
57929
|
class: "btn btn-sm btn-outline-primary",
|
|
57661
57930
|
onClick: ($event) => editProcedure(procedure)
|
|
57662
|
-
}, [_cache[
|
|
57931
|
+
}, [_cache[46] || (_cache[46] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)], 8, _hoisted_76$1), createBaseVNode("button", {
|
|
57663
57932
|
class: "btn btn-sm btn-outline-danger",
|
|
57664
57933
|
onClick: ($event) => deleteProcedure(procedure)
|
|
57665
|
-
}, [_cache[
|
|
57666
|
-
}), 128))])) : (openBlock(), createElementBlock("div",
|
|
57667
|
-
_cache[
|
|
57934
|
+
}, [_cache[47] || (_cache[47] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.delete")), 1)], 8, _hoisted_77$1)])])]);
|
|
57935
|
+
}), 128))])) : (openBlock(), createElementBlock("div", _hoisted_78$1, [
|
|
57936
|
+
_cache[49] || (_cache[49] = createBaseVNode("i", { class: "bi bi-gear" }, null, -1)),
|
|
57668
57937
|
createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.noProcedure")), 1),
|
|
57669
57938
|
createBaseVNode("button", {
|
|
57670
57939
|
class: "btn btn-info",
|
|
57671
57940
|
onClick: showCreateProcedureModal
|
|
57672
|
-
}, [_cache[
|
|
57941
|
+
}, [_cache[48] || (_cache[48] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createProcedure")), 1)])
|
|
57673
57942
|
]))], 512), [[vShow, activeTab.value === "procedures"]]),
|
|
57674
|
-
withDirectives(createBaseVNode("div",
|
|
57675
|
-
|
|
57943
|
+
withDirectives(createBaseVNode("div", _hoisted_79$1, [createBaseVNode("div", _hoisted_80$1, [_cache[50] || (_cache[50] = createBaseVNode("i", { class: "bi bi-code-slash" }, null, -1)), createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.functionInDev")), 1)])], 512), [[vShow, activeTab.value === "functions"]]),
|
|
57944
|
+
activeTab.value === "sql" && !isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_81$1, [createBaseVNode("div", _hoisted_82$1, [createVNode(sql_executor_default, {
|
|
57676
57945
|
connection: __props.connection,
|
|
57677
57946
|
database: __props.database
|
|
57678
|
-
}, null, 8, ["connection", "database"])])]
|
|
57679
|
-
|
|
57947
|
+
}, null, 8, ["connection", "database"])])])) : createCommentVNode("", true),
|
|
57948
|
+
activeTab.value === "docQuery" && isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_83$1, [createVNode(document_query_panel_default, {
|
|
57949
|
+
connection: __props.connection,
|
|
57950
|
+
database: __props.database,
|
|
57951
|
+
tables: props.tables
|
|
57952
|
+
}, null, 8, [
|
|
57953
|
+
"connection",
|
|
57954
|
+
"database",
|
|
57955
|
+
"tables"
|
|
57956
|
+
])])) : createCommentVNode("", true),
|
|
57957
|
+
withDirectives(createBaseVNode("div", _hoisted_84, [createVNode(db_tools_default, {
|
|
57680
57958
|
connection: __props.connection,
|
|
57681
57959
|
database: __props.database,
|
|
57682
57960
|
onExecuteSql: handleExecuteSQL
|
|
57683
57961
|
}, null, 8, ["connection", "database"])], 512), [[vShow, activeTab.value === "tools"]])
|
|
57684
57962
|
])]),
|
|
57685
|
-
showCreateTable.value ? (openBlock(), createElementBlock("div",
|
|
57686
|
-
createBaseVNode("div",
|
|
57963
|
+
showCreateTable.value ? (openBlock(), createElementBlock("div", _hoisted_85, [createBaseVNode("div", _hoisted_86, [createBaseVNode("div", _hoisted_87, [
|
|
57964
|
+
createBaseVNode("div", _hoisted_88, [createBaseVNode("h5", _hoisted_89, toDisplayString(_ctx.$t("databaseDetail.createTableTitle")), 1), createBaseVNode("button", {
|
|
57687
57965
|
type: "button",
|
|
57688
57966
|
class: "btn-close",
|
|
57689
|
-
onClick: _cache[
|
|
57967
|
+
onClick: _cache[7] || (_cache[7] = ($event) => showCreateTable.value = false)
|
|
57690
57968
|
})]),
|
|
57691
|
-
createBaseVNode("div",
|
|
57969
|
+
createBaseVNode("div", _hoisted_90, [createBaseVNode("form", null, [createBaseVNode("div", _hoisted_91, [createBaseVNode("label", _hoisted_92, toDisplayString(_ctx.$t("databaseDetail.tableNameLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
57692
57970
|
type: "text",
|
|
57693
57971
|
class: "form-control",
|
|
57694
|
-
"onUpdate:modelValue": _cache[
|
|
57972
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => newTable.value.name = $event),
|
|
57695
57973
|
placeholder: _ctx.$t("databaseDetail.enterTableName")
|
|
57696
|
-
}, null, 8,
|
|
57974
|
+
}, null, 8, _hoisted_93), [[vModelText, newTable.value.name]])]), createBaseVNode("div", _hoisted_94, [createBaseVNode("label", _hoisted_95, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("textarea", {
|
|
57697
57975
|
class: "form-control",
|
|
57698
|
-
"onUpdate:modelValue": _cache[
|
|
57976
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => newTable.value.comment = $event),
|
|
57699
57977
|
placeholder: _ctx.$t("databaseDetail.enterTableComment")
|
|
57700
|
-
}, null, 8,
|
|
57701
|
-
createBaseVNode("div",
|
|
57978
|
+
}, null, 8, _hoisted_96), [[vModelText, newTable.value.comment]])])])]),
|
|
57979
|
+
createBaseVNode("div", _hoisted_97, [createBaseVNode("button", {
|
|
57702
57980
|
type: "button",
|
|
57703
57981
|
class: "btn btn-secondary",
|
|
57704
|
-
onClick: _cache[
|
|
57982
|
+
onClick: _cache[10] || (_cache[10] = ($event) => showCreateTable.value = false)
|
|
57705
57983
|
}, toDisplayString(_ctx.$t("common.cancel")), 1), createBaseVNode("button", {
|
|
57706
57984
|
type: "button",
|
|
57707
57985
|
class: "btn btn-primary",
|
|
57708
57986
|
onClick: createTable
|
|
57709
57987
|
}, toDisplayString(_ctx.$t("common.create")), 1)])
|
|
57710
57988
|
])])])) : createCommentVNode("", true),
|
|
57711
|
-
showCreateView.value && editingView.value ? (openBlock(), createElementBlock("div",
|
|
57712
|
-
createBaseVNode("div",
|
|
57989
|
+
showCreateView.value && editingView.value ? (openBlock(), createElementBlock("div", _hoisted_98, [createBaseVNode("div", _hoisted_99, [createBaseVNode("div", _hoisted_100, [
|
|
57990
|
+
createBaseVNode("div", _hoisted_101, [createBaseVNode("h5", _hoisted_102, toDisplayString(views.value.some((v) => v.name === editingView.value.name) ? _ctx.$t("databaseDetail.editView") : _ctx.$t("databaseDetail.createViewTitle")), 1), createBaseVNode("button", {
|
|
57713
57991
|
type: "button",
|
|
57714
57992
|
class: "btn-close",
|
|
57715
|
-
onClick: _cache[
|
|
57993
|
+
onClick: _cache[11] || (_cache[11] = ($event) => showCreateView.value = false)
|
|
57716
57994
|
})]),
|
|
57717
|
-
createBaseVNode("div",
|
|
57718
|
-
createBaseVNode("div",
|
|
57995
|
+
createBaseVNode("div", _hoisted_103, [createBaseVNode("form", null, [
|
|
57996
|
+
createBaseVNode("div", _hoisted_104, [createBaseVNode("label", _hoisted_105, toDisplayString(_ctx.$t("databaseDetail.viewNameLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
57719
57997
|
type: "text",
|
|
57720
57998
|
class: "form-control",
|
|
57721
|
-
"onUpdate:modelValue": _cache[
|
|
57999
|
+
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => editingView.value.name = $event),
|
|
57722
58000
|
placeholder: _ctx.$t("databaseDetail.enterViewName")
|
|
57723
|
-
}, null, 8,
|
|
57724
|
-
createBaseVNode("div",
|
|
58001
|
+
}, null, 8, _hoisted_106), [[vModelText, editingView.value.name]])]),
|
|
58002
|
+
createBaseVNode("div", _hoisted_107, [createBaseVNode("label", _hoisted_108, toDisplayString(_ctx.$t("databaseDetail.viewDefinition")), 1), withDirectives(createBaseVNode("textarea", {
|
|
57725
58003
|
class: "form-control",
|
|
57726
58004
|
rows: "8",
|
|
57727
|
-
"onUpdate:modelValue": _cache[
|
|
58005
|
+
"onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => editingView.value.definition = $event),
|
|
57728
58006
|
placeholder: _ctx.$t("databaseDetail.viewDefinitionPlaceholder")
|
|
57729
|
-
}, null, 8,
|
|
57730
|
-
createBaseVNode("div",
|
|
58007
|
+
}, null, 8, _hoisted_109), [[vModelText, editingView.value.definition]])]),
|
|
58008
|
+
createBaseVNode("div", _hoisted_110, [createBaseVNode("label", _hoisted_111, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
57731
58009
|
type: "text",
|
|
57732
58010
|
class: "form-control",
|
|
57733
|
-
"onUpdate:modelValue": _cache[
|
|
58011
|
+
"onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => editingView.value.comment = $event),
|
|
57734
58012
|
placeholder: _ctx.$t("databaseDetail.enterTableComment")
|
|
57735
|
-
}, null, 8,
|
|
58013
|
+
}, null, 8, _hoisted_112), [[vModelText, editingView.value.comment]])])
|
|
57736
58014
|
])]),
|
|
57737
|
-
createBaseVNode("div",
|
|
58015
|
+
createBaseVNode("div", _hoisted_113, [createBaseVNode("button", {
|
|
57738
58016
|
type: "button",
|
|
57739
58017
|
class: "btn btn-secondary",
|
|
57740
|
-
onClick: _cache[
|
|
58018
|
+
onClick: _cache[15] || (_cache[15] = ($event) => showCreateView.value = false)
|
|
57741
58019
|
}, toDisplayString(_ctx.$t("common.cancel")), 1), createBaseVNode("button", {
|
|
57742
58020
|
type: "button",
|
|
57743
58021
|
class: "btn btn-primary",
|
|
57744
58022
|
onClick: createOrUpdateView
|
|
57745
58023
|
}, toDisplayString(_ctx.$t("common.save")), 1)])
|
|
57746
58024
|
])])])) : createCommentVNode("", true),
|
|
57747
|
-
showCreateProcedure.value && editingProcedure.value ? (openBlock(), createElementBlock("div",
|
|
57748
|
-
createBaseVNode("div",
|
|
58025
|
+
showCreateProcedure.value && editingProcedure.value ? (openBlock(), createElementBlock("div", _hoisted_114, [createBaseVNode("div", _hoisted_115, [createBaseVNode("div", _hoisted_116, [
|
|
58026
|
+
createBaseVNode("div", _hoisted_117, [createBaseVNode("h5", _hoisted_118, toDisplayString(procedures.value.some((p) => p.name === editingProcedure.value.name) ? _ctx.$t("databaseDetail.editProcedure") : _ctx.$t("databaseDetail.createProcedureTitle")), 1), createBaseVNode("button", {
|
|
57749
58027
|
type: "button",
|
|
57750
58028
|
class: "btn-close",
|
|
57751
|
-
onClick: _cache[
|
|
58029
|
+
onClick: _cache[16] || (_cache[16] = ($event) => showCreateProcedure.value = false)
|
|
57752
58030
|
})]),
|
|
57753
|
-
createBaseVNode("div",
|
|
57754
|
-
createBaseVNode("div",
|
|
58031
|
+
createBaseVNode("div", _hoisted_119, [createBaseVNode("form", null, [
|
|
58032
|
+
createBaseVNode("div", _hoisted_120, [createBaseVNode("label", _hoisted_121, toDisplayString(_ctx.$t("databaseDetail.procedureNameLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
57755
58033
|
type: "text",
|
|
57756
58034
|
class: "form-control",
|
|
57757
|
-
"onUpdate:modelValue": _cache[
|
|
58035
|
+
"onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => editingProcedure.value.name = $event),
|
|
57758
58036
|
placeholder: _ctx.$t("databaseDetail.enterProcedureName")
|
|
57759
|
-
}, null, 8,
|
|
57760
|
-
createBaseVNode("div",
|
|
58037
|
+
}, null, 8, _hoisted_122), [[vModelText, editingProcedure.value.name]])]),
|
|
58038
|
+
createBaseVNode("div", _hoisted_123, [createBaseVNode("label", _hoisted_124, toDisplayString(_ctx.$t("databaseDetail.procedureDefinition")), 1), withDirectives(createBaseVNode("textarea", {
|
|
57761
58039
|
class: "form-control",
|
|
57762
58040
|
rows: "12",
|
|
57763
|
-
"onUpdate:modelValue": _cache[
|
|
58041
|
+
"onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => editingProcedure.value.definition = $event),
|
|
57764
58042
|
placeholder: _ctx.$t("databaseDetail.procedureDefPlaceholder")
|
|
57765
|
-
}, null, 8,
|
|
57766
|
-
createBaseVNode("div",
|
|
58043
|
+
}, null, 8, _hoisted_125), [[vModelText, editingProcedure.value.definition]])]),
|
|
58044
|
+
createBaseVNode("div", _hoisted_126, [createBaseVNode("label", _hoisted_127, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("input", {
|
|
57767
58045
|
type: "text",
|
|
57768
58046
|
class: "form-control",
|
|
57769
|
-
"onUpdate:modelValue": _cache[
|
|
58047
|
+
"onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => editingProcedure.value.comment = $event),
|
|
57770
58048
|
placeholder: _ctx.$t("databaseDetail.enterTableComment")
|
|
57771
|
-
}, null, 8,
|
|
58049
|
+
}, null, 8, _hoisted_128), [[vModelText, editingProcedure.value.comment]])])
|
|
57772
58050
|
])]),
|
|
57773
|
-
createBaseVNode("div",
|
|
58051
|
+
createBaseVNode("div", _hoisted_129, [createBaseVNode("button", {
|
|
57774
58052
|
type: "button",
|
|
57775
58053
|
class: "btn btn-secondary",
|
|
57776
|
-
onClick: _cache[
|
|
58054
|
+
onClick: _cache[20] || (_cache[20] = ($event) => showCreateProcedure.value = false)
|
|
57777
58055
|
}, toDisplayString(_ctx.$t("common.cancel")), 1), createBaseVNode("button", {
|
|
57778
58056
|
type: "button",
|
|
57779
58057
|
class: "btn btn-primary",
|
|
@@ -57802,17 +58080,17 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57802
58080
|
});
|
|
57803
58081
|
}));
|
|
57804
58082
|
//#endregion
|
|
57805
|
-
//#region src/platform/database/components/database-detail.vue?vue&type=style&index=0&scoped=
|
|
57806
|
-
var
|
|
58083
|
+
//#region src/platform/database/components/database-detail.vue?vue&type=style&index=0&scoped=cd43f64d&lang.css
|
|
58084
|
+
var init_database_detail_vue_vue_type_style_index_0_scoped_cd43f64d_lang = __esmMin((() => {}));
|
|
57807
58085
|
//#endregion
|
|
57808
58086
|
//#region src/platform/database/components/database-detail.vue
|
|
57809
58087
|
var database_detail_default;
|
|
57810
58088
|
var init_database_detail = __esmMin((() => {
|
|
57811
58089
|
init_database_detail_vue_vue_type_script_setup_true_lang();
|
|
57812
58090
|
init_database_detail_vue_vue_type_script_setup_true_lang();
|
|
57813
|
-
|
|
58091
|
+
init_database_detail_vue_vue_type_style_index_0_scoped_cd43f64d_lang();
|
|
57814
58092
|
init__plugin_vue_export_helper();
|
|
57815
|
-
database_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(database_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
58093
|
+
database_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(database_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-cd43f64d"]]);
|
|
57816
58094
|
}));
|
|
57817
58095
|
//#endregion
|
|
57818
58096
|
//#region src/utils/database-types.ts
|
|
@@ -57903,13 +58181,15 @@ var init_database_types = __esmMin((() => {
|
|
|
57903
58181
|
}));
|
|
57904
58182
|
//#endregion
|
|
57905
58183
|
//#region src/platform/database/components/data-editor.vue?vue&type=script&setup=true&lang.ts
|
|
57906
|
-
var _hoisted_1$3, _hoisted_2$3, _hoisted_3$3, _hoisted_4$3, _hoisted_5$3, _hoisted_6$3, _hoisted_7$3, _hoisted_8$3, _hoisted_9$3, _hoisted_10$3, _hoisted_11$3, _hoisted_12$3, _hoisted_13$3, _hoisted_14$3, _hoisted_15$3, _hoisted_16$3, _hoisted_17$3, _hoisted_18$3, _hoisted_19$3, _hoisted_20$3, _hoisted_21$3, _hoisted_22$3, _hoisted_23$3, _hoisted_24$3, _hoisted_25$3, _hoisted_26$2, _hoisted_27$2, _hoisted_28$2, _hoisted_29$2, data_editor_vue_vue_type_script_setup_true_lang_default;
|
|
58184
|
+
var _hoisted_1$3, _hoisted_2$3, _hoisted_3$3, _hoisted_4$3, _hoisted_5$3, _hoisted_6$3, _hoisted_7$3, _hoisted_8$3, _hoisted_9$3, _hoisted_10$3, _hoisted_11$3, _hoisted_12$3, _hoisted_13$3, _hoisted_14$3, _hoisted_15$3, _hoisted_16$3, _hoisted_17$3, _hoisted_18$3, _hoisted_19$3, _hoisted_20$3, _hoisted_21$3, _hoisted_22$3, _hoisted_23$3, _hoisted_24$3, _hoisted_25$3, _hoisted_26$2, _hoisted_27$2, _hoisted_28$2, _hoisted_29$2, _hoisted_30$2, _hoisted_31$2, _hoisted_32$2, _hoisted_33$2, _hoisted_34$2, _hoisted_35$2, data_editor_vue_vue_type_script_setup_true_lang_default;
|
|
57907
58185
|
var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
57908
58186
|
init_vue_runtime_esm_bundler();
|
|
57909
58187
|
init_vue_i18n();
|
|
57910
58188
|
init_database();
|
|
57911
58189
|
init_modal();
|
|
58190
|
+
init_toast();
|
|
57912
58191
|
init_database_types();
|
|
58192
|
+
init_database_types$1();
|
|
57913
58193
|
init_dist$11();
|
|
57914
58194
|
init_dist$10();
|
|
57915
58195
|
init_dist$6();
|
|
@@ -57931,47 +58211,65 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57931
58211
|
class: "bi bi-plus-circle"
|
|
57932
58212
|
};
|
|
57933
58213
|
_hoisted_7$3 = { class: "modal-body" };
|
|
57934
|
-
_hoisted_8$3 = {
|
|
57935
|
-
|
|
57936
|
-
|
|
57937
|
-
|
|
58214
|
+
_hoisted_8$3 = {
|
|
58215
|
+
key: 0,
|
|
58216
|
+
class: "mb-3"
|
|
58217
|
+
};
|
|
58218
|
+
_hoisted_9$3 = { class: "d-flex align-items-center mb-1" };
|
|
58219
|
+
_hoisted_10$3 = { class: "form-label mb-0" };
|
|
58220
|
+
_hoisted_11$3 = { class: "text-muted ms-2" };
|
|
58221
|
+
_hoisted_12$3 = {
|
|
58222
|
+
key: 0,
|
|
58223
|
+
class: "text-danger small mt-1"
|
|
58224
|
+
};
|
|
58225
|
+
_hoisted_13$3 = {
|
|
58226
|
+
key: 1,
|
|
58227
|
+
class: "text-muted small mt-1"
|
|
58228
|
+
};
|
|
58229
|
+
_hoisted_14$3 = {
|
|
58230
|
+
key: 1,
|
|
58231
|
+
class: "row g-3"
|
|
58232
|
+
};
|
|
58233
|
+
_hoisted_15$3 = ["data-type"];
|
|
58234
|
+
_hoisted_16$3 = { class: "form-label" };
|
|
58235
|
+
_hoisted_17$3 = {
|
|
57938
58236
|
key: 0,
|
|
57939
58237
|
class: "text-danger"
|
|
57940
58238
|
};
|
|
57941
|
-
|
|
57942
|
-
|
|
57943
|
-
|
|
58239
|
+
_hoisted_18$3 = { class: "text-muted ms-2" };
|
|
58240
|
+
_hoisted_19$3 = ["value"];
|
|
58241
|
+
_hoisted_20$3 = [
|
|
57944
58242
|
"onUpdate:modelValue",
|
|
57945
58243
|
"placeholder",
|
|
57946
58244
|
"required",
|
|
57947
58245
|
"step"
|
|
57948
58246
|
];
|
|
57949
|
-
|
|
57950
|
-
|
|
58247
|
+
_hoisted_21$3 = ["onUpdate:modelValue", "required"];
|
|
58248
|
+
_hoisted_22$3 = [
|
|
57951
58249
|
"onUpdate:modelValue",
|
|
57952
58250
|
"placeholder",
|
|
57953
58251
|
"required"
|
|
57954
58252
|
];
|
|
57955
|
-
|
|
57956
|
-
|
|
57957
|
-
|
|
57958
|
-
|
|
57959
|
-
|
|
57960
|
-
|
|
57961
|
-
|
|
58253
|
+
_hoisted_23$3 = ["onUpdate:modelValue", "required"];
|
|
58254
|
+
_hoisted_24$3 = { value: "" };
|
|
58255
|
+
_hoisted_25$3 = ["value"];
|
|
58256
|
+
_hoisted_26$2 = ["onUpdate:modelValue"];
|
|
58257
|
+
_hoisted_27$2 = { value: true };
|
|
58258
|
+
_hoisted_28$2 = { value: false };
|
|
58259
|
+
_hoisted_29$2 = {
|
|
57962
58260
|
key: 6,
|
|
57963
58261
|
class: "json-editor"
|
|
57964
58262
|
};
|
|
57965
|
-
|
|
57966
|
-
|
|
57967
|
-
|
|
58263
|
+
_hoisted_30$2 = { class: "d-flex justify-content-between mt-1" };
|
|
58264
|
+
_hoisted_31$2 = ["onClick"];
|
|
58265
|
+
_hoisted_32$2 = [
|
|
57968
58266
|
"onUpdate:modelValue",
|
|
57969
58267
|
"placeholder",
|
|
57970
58268
|
"required"
|
|
57971
58269
|
];
|
|
57972
|
-
|
|
57973
|
-
|
|
57974
|
-
|
|
58270
|
+
_hoisted_33$2 = { class: "modal-footer" };
|
|
58271
|
+
_hoisted_34$2 = ["disabled"];
|
|
58272
|
+
_hoisted_35$2 = {
|
|
57975
58273
|
key: 0,
|
|
57976
58274
|
class: "spinner-border spinner-border-sm me-2"
|
|
57977
58275
|
};
|
|
@@ -57994,6 +58292,89 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
57994
58292
|
const emit = __emit;
|
|
57995
58293
|
const formData = ref({});
|
|
57996
58294
|
const loading = ref(false);
|
|
58295
|
+
const isDocDb = computed(() => isDocumentDb(props.connection?.type));
|
|
58296
|
+
const nounLabel = computed(() => nounOf(props.connection?.type, "record"));
|
|
58297
|
+
const docJson = ref("{\n \n}");
|
|
58298
|
+
const docJsonError = ref("");
|
|
58299
|
+
const docEditorRef = ref(null);
|
|
58300
|
+
const docEditorInstance = ref(null);
|
|
58301
|
+
watch(() => [
|
|
58302
|
+
props.visible,
|
|
58303
|
+
props.data,
|
|
58304
|
+
props.isEdit
|
|
58305
|
+
], async () => {
|
|
58306
|
+
if (!props.visible || !isDocDb.value) return;
|
|
58307
|
+
docJsonError.value = "";
|
|
58308
|
+
docJson.value = props.isEdit && props.data ? JSON.stringify(props.data, null, 2) : "{\n \n}";
|
|
58309
|
+
await nextTick();
|
|
58310
|
+
initDocEditor();
|
|
58311
|
+
}, {
|
|
58312
|
+
immediate: true,
|
|
58313
|
+
deep: true
|
|
58314
|
+
});
|
|
58315
|
+
/** 创建/重建文档 JSON 编辑器(docJson 为唯一数据源) */
|
|
58316
|
+
function initDocEditor() {
|
|
58317
|
+
if (!docEditorRef.value || !isDocDb.value) return;
|
|
58318
|
+
if (docEditorInstance.value) {
|
|
58319
|
+
docEditorInstance.value.destroy();
|
|
58320
|
+
docEditorInstance.value = null;
|
|
58321
|
+
}
|
|
58322
|
+
const state = EditorState.create({
|
|
58323
|
+
doc: docJson.value,
|
|
58324
|
+
extensions: [
|
|
58325
|
+
lineNumbers(),
|
|
58326
|
+
highlightActiveLineGutter(),
|
|
58327
|
+
highlightActiveLine(),
|
|
58328
|
+
drawSelection(),
|
|
58329
|
+
placeholder("{\n \n}"),
|
|
58330
|
+
json(),
|
|
58331
|
+
syntaxHighlighting(defaultHighlightStyle),
|
|
58332
|
+
keymap.of(defaultKeymap),
|
|
58333
|
+
EditorView.lineWrapping,
|
|
58334
|
+
EditorView.updateListener.of((update) => {
|
|
58335
|
+
if (update.docChanged) docJson.value = update.state.doc.toString();
|
|
58336
|
+
}),
|
|
58337
|
+
EditorView.theme({
|
|
58338
|
+
"&": {
|
|
58339
|
+
fontSize: "13px",
|
|
58340
|
+
border: "1px solid var(--db-border-soft, #dee2e6)",
|
|
58341
|
+
borderRadius: "4px"
|
|
58342
|
+
},
|
|
58343
|
+
".cm-content": {
|
|
58344
|
+
minHeight: "220px",
|
|
58345
|
+
fontFamily: "var(--bs-font-monospace, monospace)"
|
|
58346
|
+
},
|
|
58347
|
+
".cm-focused": { outline: "none" },
|
|
58348
|
+
".cm-activeLineGutter": { backgroundColor: "var(--db-border-soft)" },
|
|
58349
|
+
".cm-activeLine": { backgroundColor: "var(--db-border-soft)" }
|
|
58350
|
+
})
|
|
58351
|
+
]
|
|
58352
|
+
});
|
|
58353
|
+
docEditorInstance.value = new EditorView({
|
|
58354
|
+
state,
|
|
58355
|
+
parent: docEditorRef.value
|
|
58356
|
+
});
|
|
58357
|
+
}
|
|
58358
|
+
function destroyDocEditor() {
|
|
58359
|
+
docEditorInstance.value?.destroy();
|
|
58360
|
+
docEditorInstance.value = null;
|
|
58361
|
+
}
|
|
58362
|
+
/** 格式化:解析当前内容并重新缩进,解析失败时给出提示 */
|
|
58363
|
+
function formatDocJson() {
|
|
58364
|
+
try {
|
|
58365
|
+
const parsed = JSON.parse(docJson.value);
|
|
58366
|
+
const formatted = JSON.stringify(parsed, null, 2);
|
|
58367
|
+
docJson.value = formatted;
|
|
58368
|
+
docJsonError.value = "";
|
|
58369
|
+
docEditorInstance.value?.dispatch({ changes: {
|
|
58370
|
+
from: 0,
|
|
58371
|
+
to: docEditorInstance.value.state.doc.length,
|
|
58372
|
+
insert: formatted
|
|
58373
|
+
} });
|
|
58374
|
+
} catch (e) {
|
|
58375
|
+
docJsonError.value = t("dataEditor.docJsonInvalid", { message: e?.message || e });
|
|
58376
|
+
}
|
|
58377
|
+
}
|
|
57997
58378
|
const jsonText = ref({});
|
|
57998
58379
|
const jsonError = ref({});
|
|
57999
58380
|
const jsonEditorRefs = ref({});
|
|
@@ -58006,7 +58387,10 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58006
58387
|
initializeFormData();
|
|
58007
58388
|
await nextTick();
|
|
58008
58389
|
initJsonEditors();
|
|
58009
|
-
} else
|
|
58390
|
+
} else {
|
|
58391
|
+
destroyJsonEditors();
|
|
58392
|
+
destroyDocEditor();
|
|
58393
|
+
}
|
|
58010
58394
|
});
|
|
58011
58395
|
function initJsonEditors() {
|
|
58012
58396
|
props.columns.forEach((column) => {
|
|
@@ -58173,6 +58557,25 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58173
58557
|
}
|
|
58174
58558
|
async function handleSubmit() {
|
|
58175
58559
|
try {
|
|
58560
|
+
if (isDocDb.value) {
|
|
58561
|
+
let doc;
|
|
58562
|
+
try {
|
|
58563
|
+
doc = JSON.parse(docJson.value);
|
|
58564
|
+
} catch (e) {
|
|
58565
|
+
docJsonError.value = t("dataEditor.docJsonInvalid", { message: e?.message || e });
|
|
58566
|
+
return;
|
|
58567
|
+
}
|
|
58568
|
+
if (!doc || typeof doc !== "object" || Array.isArray(doc)) {
|
|
58569
|
+
docJsonError.value = t("dataEditor.docJsonRequired");
|
|
58570
|
+
return;
|
|
58571
|
+
}
|
|
58572
|
+
docJsonError.value = "";
|
|
58573
|
+
loading.value = true;
|
|
58574
|
+
const response = props.isEdit && props.data ? await databaseService.updateData(props.connection?.id || "", props.database || "", props.tableName || "", doc, void 0, props.data?._id) : await databaseService.insertData(props.connection?.id || "", props.database || "", props.tableName || "", doc);
|
|
58575
|
+
loading.value = false;
|
|
58576
|
+
emit("submit", response);
|
|
58577
|
+
return;
|
|
58578
|
+
}
|
|
58176
58579
|
let hasInvalidJson = false;
|
|
58177
58580
|
props.columns.forEach((column) => {
|
|
58178
58581
|
if (isJsonInput(column.type) || isArrayInput(column.type)) {
|
|
@@ -58207,7 +58610,7 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58207
58610
|
response = await databaseService.updateData(props.connection?.id || "", props.database || "", props.tableName || "", submitData, whereClause);
|
|
58208
58611
|
} else response = await databaseService.insertData(props.connection?.id || "", props.database || "", props.tableName || "", submitData);
|
|
58209
58612
|
if (response.ret === 0) {
|
|
58210
|
-
|
|
58613
|
+
toast.success(props.isEdit ? t("dataEditor.updateSuccess") : t("dataEditor.insertSuccess"));
|
|
58211
58614
|
closeModal();
|
|
58212
58615
|
nextTick(() => {
|
|
58213
58616
|
emit("submit", response);
|
|
@@ -58250,15 +58653,27 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58250
58653
|
class: "btn-close",
|
|
58251
58654
|
onClick: closeModal
|
|
58252
58655
|
})]),
|
|
58253
|
-
createBaseVNode("div", _hoisted_7$3, [createBaseVNode("form", { onSubmit: withModifiers(handleSubmit, ["prevent"]) }, [
|
|
58656
|
+
createBaseVNode("div", _hoisted_7$3, [createBaseVNode("form", { onSubmit: withModifiers(handleSubmit, ["prevent"]) }, [isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
|
|
58657
|
+
createBaseVNode("div", _hoisted_9$3, [createBaseVNode("label", _hoisted_10$3, [createTextVNode(toDisplayString(nounLabel.value) + " JSON ", 1), createBaseVNode("small", _hoisted_11$3, toDisplayString(__props.isEdit ? _ctx.$t("dataEditor.editDocHint") : _ctx.$t("dataEditor.newDocHint")), 1)]), createBaseVNode("button", {
|
|
58658
|
+
type: "button",
|
|
58659
|
+
class: "btn btn-outline-secondary btn-sm ms-auto",
|
|
58660
|
+
onClick: formatDocJson
|
|
58661
|
+
}, [_cache[0] || (_cache[0] = createBaseVNode("i", { class: "bi bi-magic" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.format")), 1)])]),
|
|
58662
|
+
createBaseVNode("div", {
|
|
58663
|
+
ref_key: "docEditorRef",
|
|
58664
|
+
ref: docEditorRef,
|
|
58665
|
+
class: "doc-json-editor"
|
|
58666
|
+
}, null, 512),
|
|
58667
|
+
docJsonError.value ? (openBlock(), createElementBlock("div", _hoisted_12$3, toDisplayString(docJsonError.value), 1)) : (openBlock(), createElementBlock("div", _hoisted_13$3, toDisplayString(__props.isEdit ? _ctx.$t("dataEditor.docSaveEditHint") : _ctx.$t("dataEditor.docSaveInsertHint")), 1))
|
|
58668
|
+
])) : createCommentVNode("", true), !isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_14$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column) => {
|
|
58254
58669
|
return openBlock(), createElementBlock("div", {
|
|
58255
58670
|
key: column.name,
|
|
58256
58671
|
"data-type": column.type,
|
|
58257
58672
|
class: "col-md-6"
|
|
58258
|
-
}, [createBaseVNode("label",
|
|
58673
|
+
}, [createBaseVNode("label", _hoisted_16$3, [
|
|
58259
58674
|
createTextVNode(toDisplayString(column.name) + " ", 1),
|
|
58260
|
-
column.isPrimary ? (openBlock(), createElementBlock("span",
|
|
58261
|
-
createBaseVNode("small",
|
|
58675
|
+
column.isPrimary ? (openBlock(), createElementBlock("span", _hoisted_17$3, "*")) : createCommentVNode("", true),
|
|
58676
|
+
createBaseVNode("small", _hoisted_18$3, toDisplayString(column.type), 1)
|
|
58262
58677
|
]), column.isPrimary && column.isAutoIncrement ? (openBlock(), createElementBlock("input", {
|
|
58263
58678
|
key: 0,
|
|
58264
58679
|
type: "text",
|
|
@@ -58267,7 +58682,7 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58267
58682
|
value: __props.isEdit ? formData.value[column.name] : _ctx.$t("dataEditor.autoGenerate"),
|
|
58268
58683
|
disabled: "",
|
|
58269
58684
|
readonly: ""
|
|
58270
|
-
}, null, 8,
|
|
58685
|
+
}, null, 8, _hoisted_19$3)) : isNumberInput(column.type) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
58271
58686
|
key: 1,
|
|
58272
58687
|
type: "number",
|
|
58273
58688
|
"data-type": "number",
|
|
@@ -58276,14 +58691,14 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58276
58691
|
placeholder: _ctx.$t("dataEditor.inputPlaceholder", { name: column.name }),
|
|
58277
58692
|
required: !column.nullable,
|
|
58278
58693
|
step: isDecimalInput(column.type) ? "0.01" : "1"
|
|
58279
|
-
}, null, 8,
|
|
58694
|
+
}, null, 8, _hoisted_20$3)), [[vModelText, formData.value[column.name]]]) : isDateInput(column.type) ? withDirectives((openBlock(), createElementBlock("input", {
|
|
58280
58695
|
key: 2,
|
|
58281
58696
|
type: "datetime-local",
|
|
58282
58697
|
class: "form-control",
|
|
58283
58698
|
"data-type": "date",
|
|
58284
58699
|
"onUpdate:modelValue": ($event) => formData.value[column.name] = $event,
|
|
58285
58700
|
required: !column.nullable
|
|
58286
|
-
}, null, 8,
|
|
58701
|
+
}, null, 8, _hoisted_21$3)), [[vModelText, formData.value[column.name]]]) : isTextArea(column.type) ? withDirectives((openBlock(), createElementBlock("textarea", {
|
|
58287
58702
|
key: 3,
|
|
58288
58703
|
class: "form-control",
|
|
58289
58704
|
"data-type": "textarea",
|
|
@@ -58291,23 +58706,23 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58291
58706
|
placeholder: _ctx.$t("dataEditor.inputPlaceholder", { name: column.name }),
|
|
58292
58707
|
required: !column.nullable,
|
|
58293
58708
|
rows: "3"
|
|
58294
|
-
}, null, 8,
|
|
58709
|
+
}, null, 8, _hoisted_22$3)), [[vModelText, formData.value[column.name]]]) : isEnumInput(column.type) ? withDirectives((openBlock(), createElementBlock("select", {
|
|
58295
58710
|
key: 4,
|
|
58296
58711
|
class: "form-select",
|
|
58297
58712
|
"data-type": "select",
|
|
58298
58713
|
"onUpdate:modelValue": ($event) => formData.value[column.name] = $event,
|
|
58299
58714
|
required: !column.nullable
|
|
58300
|
-
}, [createBaseVNode("option",
|
|
58715
|
+
}, [createBaseVNode("option", _hoisted_24$3, toDisplayString(_ctx.$t("dataEditor.selectPlaceholder")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(getEnumOptions(column.type), (option) => {
|
|
58301
58716
|
return openBlock(), createElementBlock("option", {
|
|
58302
58717
|
key: option,
|
|
58303
58718
|
value: option
|
|
58304
|
-
}, toDisplayString(option), 9,
|
|
58305
|
-
}), 128))], 8,
|
|
58719
|
+
}, toDisplayString(option), 9, _hoisted_25$3);
|
|
58720
|
+
}), 128))], 8, _hoisted_23$3)), [[vModelSelect, formData.value[column.name]]]) : isBooleanInput(column.type) ? withDirectives((openBlock(), createElementBlock("select", {
|
|
58306
58721
|
key: 5,
|
|
58307
58722
|
class: "form-select",
|
|
58308
58723
|
"data-type": "boolean",
|
|
58309
58724
|
"onUpdate:modelValue": ($event) => formData.value[column.name] = $event
|
|
58310
|
-
}, [createBaseVNode("option",
|
|
58725
|
+
}, [createBaseVNode("option", _hoisted_27$2, toDisplayString(_ctx.$t("dataEditor.trueLabel")), 1), createBaseVNode("option", _hoisted_28$2, toDisplayString(_ctx.$t("dataEditor.falseLabel")), 1)], 8, _hoisted_26$2)), [[vModelSelect, formData.value[column.name]]]) : isJsonInput(column.type, "input") || isArrayInput(column.type) ? (openBlock(), createElementBlock("div", _hoisted_29$2, [createBaseVNode("div", {
|
|
58311
58726
|
class: "json-editor-container",
|
|
58312
58727
|
ref_for: true,
|
|
58313
58728
|
ref: (el) => setJsonEditorRef(el, column.name),
|
|
@@ -58317,11 +58732,11 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58317
58732
|
"overflow": "hidden",
|
|
58318
58733
|
"height": "200px"
|
|
58319
58734
|
}
|
|
58320
|
-
}, null, 512), createBaseVNode("div",
|
|
58735
|
+
}, null, 512), createBaseVNode("div", _hoisted_30$2, [createBaseVNode("small", { class: normalizeClass(jsonError.value[column.name] ? "text-danger" : "text-success") }, toDisplayString(jsonError.value[column.name] || _ctx.$t("dataEditor.jsonCorrect")), 3), createBaseVNode("button", {
|
|
58321
58736
|
type: "button",
|
|
58322
58737
|
class: "btn btn-sm btn-outline-primary",
|
|
58323
58738
|
onClick: ($event) => formatJson(column.name)
|
|
58324
|
-
}, toDisplayString(_ctx.$t("common.format")), 9,
|
|
58739
|
+
}, toDisplayString(_ctx.$t("common.format")), 9, _hoisted_31$2)])])) : withDirectives((openBlock(), createElementBlock("input", {
|
|
58325
58740
|
key: 7,
|
|
58326
58741
|
type: "text",
|
|
58327
58742
|
"data-type": "normal",
|
|
@@ -58329,9 +58744,9 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58329
58744
|
"onUpdate:modelValue": ($event) => formData.value[column.name] = $event,
|
|
58330
58745
|
placeholder: _ctx.$t("dataEditor.inputPlaceholder", { name: column.name }),
|
|
58331
58746
|
required: !column.nullable
|
|
58332
|
-
}, null, 8,
|
|
58333
|
-
}), 128))])], 32)]),
|
|
58334
|
-
createBaseVNode("div",
|
|
58747
|
+
}, null, 8, _hoisted_32$2)), [[vModelText, formData.value[column.name]]])], 8, _hoisted_15$3);
|
|
58748
|
+
}), 128))])) : createCommentVNode("", true)], 32)]),
|
|
58749
|
+
createBaseVNode("div", _hoisted_33$2, [createBaseVNode("button", {
|
|
58335
58750
|
type: "button",
|
|
58336
58751
|
class: "btn btn-secondary",
|
|
58337
58752
|
onClick: closeModal
|
|
@@ -58340,30 +58755,31 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58340
58755
|
class: "btn btn-primary",
|
|
58341
58756
|
onClick: handleSubmit,
|
|
58342
58757
|
disabled: loading.value
|
|
58343
|
-
}, [loading.value ? (openBlock(), createElementBlock("span",
|
|
58758
|
+
}, [loading.value ? (openBlock(), createElementBlock("span", _hoisted_35$2)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString(__props.isEdit ? _ctx.$t("dataEditor.updateBtn") : _ctx.$t("dataEditor.insertBtn")), 1)], 8, _hoisted_34$2)])
|
|
58344
58759
|
])])], 6);
|
|
58345
58760
|
};
|
|
58346
58761
|
}
|
|
58347
58762
|
});
|
|
58348
58763
|
}));
|
|
58349
58764
|
//#endregion
|
|
58350
|
-
//#region src/platform/database/components/data-editor.vue?vue&type=style&index=0&scoped=
|
|
58351
|
-
var
|
|
58765
|
+
//#region src/platform/database/components/data-editor.vue?vue&type=style&index=0&scoped=248fb70e&lang.css
|
|
58766
|
+
var init_data_editor_vue_vue_type_style_index_0_scoped_248fb70e_lang = __esmMin((() => {}));
|
|
58352
58767
|
//#endregion
|
|
58353
58768
|
//#region src/platform/database/components/data-editor.vue
|
|
58354
58769
|
var data_editor_default;
|
|
58355
58770
|
var init_data_editor = __esmMin((() => {
|
|
58356
58771
|
init_data_editor_vue_vue_type_script_setup_true_lang();
|
|
58357
58772
|
init_data_editor_vue_vue_type_script_setup_true_lang();
|
|
58358
|
-
|
|
58773
|
+
init_data_editor_vue_vue_type_style_index_0_scoped_248fb70e_lang();
|
|
58359
58774
|
init__plugin_vue_export_helper();
|
|
58360
|
-
data_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(data_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
58775
|
+
data_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(data_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-248fb70e"]]);
|
|
58361
58776
|
}));
|
|
58362
58777
|
//#endregion
|
|
58363
58778
|
//#region src/platform/database/components/table-data-grid.vue?vue&type=script&setup=true&lang.ts
|
|
58364
58779
|
var _hoisted_1$2, _hoisted_2$2, _hoisted_3$2, _hoisted_4$2, _hoisted_5$2, _hoisted_6$2, _hoisted_7$2, _hoisted_8$2, _hoisted_9$2, _hoisted_10$2, _hoisted_11$2, _hoisted_12$2, _hoisted_13$2, _hoisted_14$2, _hoisted_15$2, _hoisted_16$2, _hoisted_17$2, _hoisted_18$2, _hoisted_19$2, _hoisted_20$2, _hoisted_21$2, _hoisted_22$2, _hoisted_23$2, _hoisted_24$2, _hoisted_25$2, table_data_grid_vue_vue_type_script_setup_true_lang_default;
|
|
58365
58780
|
var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
58366
58781
|
init_vue_runtime_esm_bundler();
|
|
58782
|
+
init_vue_i18n();
|
|
58367
58783
|
init_dataGrid();
|
|
58368
58784
|
init_pagination();
|
|
58369
58785
|
init_database();
|
|
@@ -58375,11 +58791,7 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58375
58791
|
_hoisted_6$2 = ["onClick", "title"];
|
|
58376
58792
|
_hoisted_7$2 = { class: "header-main" };
|
|
58377
58793
|
_hoisted_8$2 = { class: "column-name" };
|
|
58378
|
-
_hoisted_9$2 =
|
|
58379
|
-
key: 0,
|
|
58380
|
-
class: "column-key text-primary ms-1",
|
|
58381
|
-
title: "主键"
|
|
58382
|
-
};
|
|
58794
|
+
_hoisted_9$2 = ["title"];
|
|
58383
58795
|
_hoisted_10$2 = { class: "sort-icon ms-1" };
|
|
58384
58796
|
_hoisted_11$2 = {
|
|
58385
58797
|
key: 0,
|
|
@@ -58418,6 +58830,7 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58418
58830
|
},
|
|
58419
58831
|
emits: ["edit-row", "delete-row"],
|
|
58420
58832
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
58833
|
+
const { t } = useI18n();
|
|
58421
58834
|
const props = __props;
|
|
58422
58835
|
const emits = __emit;
|
|
58423
58836
|
const databaseService = new DatabaseService();
|
|
@@ -58458,7 +58871,7 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58458
58871
|
}));
|
|
58459
58872
|
cols.push({
|
|
58460
58873
|
name: "actions",
|
|
58461
|
-
text: "
|
|
58874
|
+
text: t("tableDetail.operationsHeader"),
|
|
58462
58875
|
sortable: false,
|
|
58463
58876
|
headerStyle: "width: 100px;"
|
|
58464
58877
|
});
|
|
@@ -58569,7 +58982,11 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58569
58982
|
title: column.comment || column.name
|
|
58570
58983
|
}, [createBaseVNode("div", _hoisted_7$2, [
|
|
58571
58984
|
createBaseVNode("span", _hoisted_8$2, toDisplayString(column.name), 1),
|
|
58572
|
-
column.isPrimary ? (openBlock(), createElementBlock("span",
|
|
58985
|
+
column.isPrimary ? (openBlock(), createElementBlock("span", {
|
|
58986
|
+
key: 0,
|
|
58987
|
+
class: "column-key text-primary ms-1",
|
|
58988
|
+
title: _ctx.$t("tableDetail.primaryKeyHeader")
|
|
58989
|
+
}, [..._cache[3] || (_cache[3] = [createBaseVNode("i", { class: "bi bi-key-fill" }, null, -1)])], 8, _hoisted_9$2)) : createCommentVNode("", true),
|
|
58573
58990
|
createBaseVNode("span", _hoisted_10$2, [sortField.value === column.name && sortOrder.value === "ASC" ? (openBlock(), createElementBlock("i", _hoisted_11$2)) : sortField.value === column.name && sortOrder.value === "DESC" ? (openBlock(), createElementBlock("i", _hoisted_12$2)) : (openBlock(), createElementBlock("i", _hoisted_13$2))])
|
|
58574
58991
|
]), createBaseVNode("div", _hoisted_14$2, [createBaseVNode("small", _hoisted_15$2, toDisplayString(column.type), 1), column.comment ? (openBlock(), createElementBlock("small", _hoisted_16$2, "- " + toDisplayString(column.comment), 1)) : createCommentVNode("", true)])], 8, _hoisted_6$2)])
|
|
58575
58992
|
};
|
|
@@ -58623,31 +59040,33 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58623
59040
|
});
|
|
58624
59041
|
}));
|
|
58625
59042
|
//#endregion
|
|
58626
|
-
//#region src/platform/database/components/table-data-grid.vue?vue&type=style&index=0&scoped=
|
|
58627
|
-
var
|
|
59043
|
+
//#region src/platform/database/components/table-data-grid.vue?vue&type=style&index=0&scoped=87baf68d&lang.css
|
|
59044
|
+
var init_table_data_grid_vue_vue_type_style_index_0_scoped_87baf68d_lang = __esmMin((() => {}));
|
|
58628
59045
|
//#endregion
|
|
58629
59046
|
//#region src/platform/database/components/table-data-grid.vue
|
|
58630
59047
|
var table_data_grid_default;
|
|
58631
59048
|
var init_table_data_grid = __esmMin((() => {
|
|
58632
59049
|
init_table_data_grid_vue_vue_type_script_setup_true_lang();
|
|
58633
59050
|
init_table_data_grid_vue_vue_type_script_setup_true_lang();
|
|
58634
|
-
|
|
59051
|
+
init_table_data_grid_vue_vue_type_style_index_0_scoped_87baf68d_lang();
|
|
58635
59052
|
init__plugin_vue_export_helper();
|
|
58636
|
-
table_data_grid_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_data_grid_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
59053
|
+
table_data_grid_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_data_grid_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-87baf68d"]]);
|
|
58637
59054
|
}));
|
|
58638
59055
|
//#endregion
|
|
58639
59056
|
//#region src/platform/database/components/table-detail.vue?vue&type=script&setup=true&lang.ts
|
|
58640
|
-
var _hoisted_1$1, _hoisted_2$1, _hoisted_3$1, _hoisted_4$1, _hoisted_5$1, _hoisted_6$1, _hoisted_7$1, _hoisted_8$1, _hoisted_9$1, _hoisted_10$1, _hoisted_11$1, _hoisted_12$1, _hoisted_13$1, _hoisted_14$1, _hoisted_15$1, _hoisted_16$1, _hoisted_17$1, _hoisted_18$1, _hoisted_19$1, _hoisted_20$1, _hoisted_21$1, _hoisted_22$1, _hoisted_23$1, _hoisted_24$1, _hoisted_25$1, _hoisted_26$1, _hoisted_27$1, _hoisted_28$1, _hoisted_29$1, _hoisted_30$1, _hoisted_31$1, _hoisted_32$1, _hoisted_33$1, _hoisted_34$1, _hoisted_35$1, _hoisted_36$1, _hoisted_37$1, _hoisted_38$1, _hoisted_39$1, _hoisted_40$1, _hoisted_41$1, _hoisted_42$1, _hoisted_43$1, _hoisted_44$1, _hoisted_45$1, _hoisted_46$1, _hoisted_47, _hoisted_48, _hoisted_49, _hoisted_50, _hoisted_51, _hoisted_52, _hoisted_53, _hoisted_54, _hoisted_55, _hoisted_56, _hoisted_57, _hoisted_58, _hoisted_59, _hoisted_60, _hoisted_61, _hoisted_62, _hoisted_63, _hoisted_64, _hoisted_65, _hoisted_66, _hoisted_67, _hoisted_68, _hoisted_69, _hoisted_70, _hoisted_71, table_detail_vue_vue_type_script_setup_true_lang_default;
|
|
59057
|
+
var _hoisted_1$1, _hoisted_2$1, _hoisted_3$1, _hoisted_4$1, _hoisted_5$1, _hoisted_6$1, _hoisted_7$1, _hoisted_8$1, _hoisted_9$1, _hoisted_10$1, _hoisted_11$1, _hoisted_12$1, _hoisted_13$1, _hoisted_14$1, _hoisted_15$1, _hoisted_16$1, _hoisted_17$1, _hoisted_18$1, _hoisted_19$1, _hoisted_20$1, _hoisted_21$1, _hoisted_22$1, _hoisted_23$1, _hoisted_24$1, _hoisted_25$1, _hoisted_26$1, _hoisted_27$1, _hoisted_28$1, _hoisted_29$1, _hoisted_30$1, _hoisted_31$1, _hoisted_32$1, _hoisted_33$1, _hoisted_34$1, _hoisted_35$1, _hoisted_36$1, _hoisted_37$1, _hoisted_38$1, _hoisted_39$1, _hoisted_40$1, _hoisted_41$1, _hoisted_42$1, _hoisted_43$1, _hoisted_44$1, _hoisted_45$1, _hoisted_46$1, _hoisted_47$1, _hoisted_48, _hoisted_49, _hoisted_50, _hoisted_51, _hoisted_52, _hoisted_53, _hoisted_54, _hoisted_55, _hoisted_56, _hoisted_57, _hoisted_58, _hoisted_59, _hoisted_60, _hoisted_61, _hoisted_62, _hoisted_63, _hoisted_64, _hoisted_65, _hoisted_66, _hoisted_67, _hoisted_68, _hoisted_69, _hoisted_70, _hoisted_71, _hoisted_72, _hoisted_73, _hoisted_74, _hoisted_75, _hoisted_76, _hoisted_77, _hoisted_78, _hoisted_79, _hoisted_80, _hoisted_81, _hoisted_82, _hoisted_83, table_detail_vue_vue_type_script_setup_true_lang_default;
|
|
58641
59058
|
var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
58642
59059
|
init_vue_runtime_esm_bundler();
|
|
58643
59060
|
init_vue_i18n();
|
|
58644
59061
|
init_database();
|
|
58645
59062
|
init_data_editor();
|
|
59063
|
+
init_database_types$1();
|
|
58646
59064
|
init_table_data_grid();
|
|
58647
59065
|
init_table_editor();
|
|
58648
59066
|
init_sql_executor();
|
|
58649
59067
|
init_export();
|
|
58650
59068
|
init_modal();
|
|
59069
|
+
init_toast();
|
|
58651
59070
|
init_database_types();
|
|
58652
59071
|
init_detect();
|
|
58653
59072
|
init_rpc();
|
|
@@ -58698,8 +59117,14 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58698
59117
|
};
|
|
58699
59118
|
_hoisted_34$1 = { class: "nav-item" };
|
|
58700
59119
|
_hoisted_35$1 = { class: "nav-item" };
|
|
58701
|
-
_hoisted_36$1 = {
|
|
58702
|
-
|
|
59120
|
+
_hoisted_36$1 = {
|
|
59121
|
+
key: 0,
|
|
59122
|
+
class: "nav-item"
|
|
59123
|
+
};
|
|
59124
|
+
_hoisted_37$1 = {
|
|
59125
|
+
key: 1,
|
|
59126
|
+
class: "nav-item"
|
|
59127
|
+
};
|
|
58703
59128
|
_hoisted_38$1 = { class: "tab-content" };
|
|
58704
59129
|
_hoisted_39$1 = { class: "tab-panel" };
|
|
58705
59130
|
_hoisted_40$1 = { class: "tab-panel" };
|
|
@@ -58709,7 +59134,7 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58709
59134
|
_hoisted_44$1 = { class: "table table-bordered" };
|
|
58710
59135
|
_hoisted_45$1 = { class: "table-dark" };
|
|
58711
59136
|
_hoisted_46$1 = { width: "100" };
|
|
58712
|
-
_hoisted_47 = {
|
|
59137
|
+
_hoisted_47$1 = {
|
|
58713
59138
|
key: 0,
|
|
58714
59139
|
class: "badge bg-primary"
|
|
58715
59140
|
};
|
|
@@ -58722,24 +59147,54 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58722
59147
|
_hoisted_51 = ["title", "onClick"];
|
|
58723
59148
|
_hoisted_52 = { class: "tab-panel" };
|
|
58724
59149
|
_hoisted_53 = { class: "indexes-content" };
|
|
58725
|
-
_hoisted_54 = {
|
|
58726
|
-
|
|
58727
|
-
|
|
58728
|
-
|
|
58729
|
-
|
|
58730
|
-
|
|
58731
|
-
|
|
58732
|
-
|
|
58733
|
-
|
|
58734
|
-
|
|
58735
|
-
|
|
58736
|
-
|
|
58737
|
-
|
|
58738
|
-
|
|
58739
|
-
|
|
58740
|
-
|
|
58741
|
-
|
|
58742
|
-
|
|
59150
|
+
_hoisted_54 = {
|
|
59151
|
+
key: 0,
|
|
59152
|
+
class: "mb-2"
|
|
59153
|
+
};
|
|
59154
|
+
_hoisted_55 = {
|
|
59155
|
+
key: 1,
|
|
59156
|
+
class: "create-index-form mb-3 p-2 border rounded"
|
|
59157
|
+
};
|
|
59158
|
+
_hoisted_56 = { class: "row g-2 align-items-end" };
|
|
59159
|
+
_hoisted_57 = { class: "col-md-5" };
|
|
59160
|
+
_hoisted_58 = { class: "form-label small mb-1" };
|
|
59161
|
+
_hoisted_59 = { class: "col-md-3" };
|
|
59162
|
+
_hoisted_60 = { class: "form-label small mb-1" };
|
|
59163
|
+
_hoisted_61 = { class: "col-md-2" };
|
|
59164
|
+
_hoisted_62 = { class: "form-check" };
|
|
59165
|
+
_hoisted_63 = {
|
|
59166
|
+
class: "form-check-label small",
|
|
59167
|
+
for: "uniqIdx"
|
|
59168
|
+
};
|
|
59169
|
+
_hoisted_64 = { class: "col-md-2" };
|
|
59170
|
+
_hoisted_65 = {
|
|
59171
|
+
key: 0,
|
|
59172
|
+
class: "text-danger small mt-1"
|
|
59173
|
+
};
|
|
59174
|
+
_hoisted_66 = { class: "indexes-table" };
|
|
59175
|
+
_hoisted_67 = { class: "table table-bordered" };
|
|
59176
|
+
_hoisted_68 = { class: "table-dark" };
|
|
59177
|
+
_hoisted_69 = { width: "100" };
|
|
59178
|
+
_hoisted_70 = { class: "badge bg-info" };
|
|
59179
|
+
_hoisted_71 = { class: "btn-group btn-group-sm" };
|
|
59180
|
+
_hoisted_72 = ["onClick"];
|
|
59181
|
+
_hoisted_73 = ["onClick"];
|
|
59182
|
+
_hoisted_74 = {
|
|
59183
|
+
key: 0,
|
|
59184
|
+
class: "tab-panel"
|
|
59185
|
+
};
|
|
59186
|
+
_hoisted_75 = { class: "relations-content" };
|
|
59187
|
+
_hoisted_76 = { class: "relations-table" };
|
|
59188
|
+
_hoisted_77 = { class: "table table-bordered" };
|
|
59189
|
+
_hoisted_78 = { class: "table-dark" };
|
|
59190
|
+
_hoisted_79 = { width: "100" };
|
|
59191
|
+
_hoisted_80 = { class: "btn-group btn-group-sm" };
|
|
59192
|
+
_hoisted_81 = ["onClick"];
|
|
59193
|
+
_hoisted_82 = {
|
|
59194
|
+
key: 1,
|
|
59195
|
+
class: "tab-panel"
|
|
59196
|
+
};
|
|
59197
|
+
_hoisted_83 = { class: "sql-section" };
|
|
58743
59198
|
table_detail_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
58744
59199
|
__name: "table-detail",
|
|
58745
59200
|
props: {
|
|
@@ -58778,6 +59233,14 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58778
59233
|
const showDataEditor = ref(false);
|
|
58779
59234
|
const isEditMode = ref(false);
|
|
58780
59235
|
const editingRow = ref(null);
|
|
59236
|
+
const isDocDb = computed(() => isDocumentDb(props.connection?.type));
|
|
59237
|
+
computed(() => nounOf(props.connection?.type, "table"));
|
|
59238
|
+
computed(() => nounOf(props.connection?.type, "record"));
|
|
59239
|
+
const showCreateIndex = ref(false);
|
|
59240
|
+
const newIndexKeys = ref("{\n \n}");
|
|
59241
|
+
const newIndexName = ref("");
|
|
59242
|
+
const newIndexUnique = ref(false);
|
|
59243
|
+
const indexError = ref("");
|
|
58781
59244
|
const showTableEditor = ref(false);
|
|
58782
59245
|
const tableEditorMode = ref("edit");
|
|
58783
59246
|
const safeTableColumns = computed(() => {
|
|
@@ -58856,6 +59319,19 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58856
59319
|
cancelButtonText: t("common.cancel"),
|
|
58857
59320
|
type: "danger"
|
|
58858
59321
|
})) {
|
|
59322
|
+
if (isDocDb.value) {
|
|
59323
|
+
const docId = row?._id;
|
|
59324
|
+
if (!docId) {
|
|
59325
|
+
await modal.warning(t("tableDetail.docMissingId"));
|
|
59326
|
+
return;
|
|
59327
|
+
}
|
|
59328
|
+
const resp = await databaseService.deleteData(props.connection?.id || "", props.database, props.table?.name || "", void 0, String(docId));
|
|
59329
|
+
if (resp.ret === 0) {
|
|
59330
|
+
toast.success(t("tableDetail.deleteSuccess"));
|
|
59331
|
+
refreshData();
|
|
59332
|
+
} else await modal.error(t("tableDetail.deleteFailed") + ": " + (resp.msg || t("common.unknown")));
|
|
59333
|
+
return;
|
|
59334
|
+
}
|
|
58859
59335
|
const primaryKeys = props.tableStructure?.columns?.filter((col) => col.isPrimary) || [];
|
|
58860
59336
|
if (primaryKeys.length === 0) {
|
|
58861
59337
|
await modal.warning(t("tableDetail.noPrimaryKey"));
|
|
@@ -58867,7 +59343,7 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58867
59343
|
});
|
|
58868
59344
|
const response = await databaseService.deleteData(props.connection?.id || "", props.database, props.table?.name || "", where);
|
|
58869
59345
|
if (response.ret === 0) {
|
|
58870
|
-
|
|
59346
|
+
toast.success(t("tableDetail.deleteSuccess"));
|
|
58871
59347
|
refreshData();
|
|
58872
59348
|
} else await modal.error(t("tableDetail.deleteFailed") + ": " + (response.msg || t("common.unknown")));
|
|
58873
59349
|
}
|
|
@@ -58883,10 +59359,8 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58883
59359
|
cancelButtonText: t("common.cancel"),
|
|
58884
59360
|
type: "danger"
|
|
58885
59361
|
})) if ((await databaseService.truncateTable(props.connection?.id || "", props.database, props.table?.name || "")).ret === 0) {
|
|
58886
|
-
|
|
58887
|
-
|
|
58888
|
-
refreshData();
|
|
58889
|
-
});
|
|
59362
|
+
toast.success(t("tableDetail.truncateSuccess"));
|
|
59363
|
+
refreshData();
|
|
58890
59364
|
} else await modal.error(t("tableDetail.truncateFailed"));
|
|
58891
59365
|
} catch (error) {
|
|
58892
59366
|
console.error("清空表失败:", error);
|
|
@@ -58901,7 +59375,7 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58901
59375
|
})) try {
|
|
58902
59376
|
const response = await databaseService.dropTable(props.connection?.id || "", props.database, props.table?.name || "");
|
|
58903
59377
|
if (response.ret === 0 && response.data?.success) {
|
|
58904
|
-
|
|
59378
|
+
toast.success(t("tableDetail.dropSuccess"));
|
|
58905
59379
|
emit("refresh-database");
|
|
58906
59380
|
} else await modal.error(t("tableDetail.dropFailed"));
|
|
58907
59381
|
} catch (error) {
|
|
@@ -58920,6 +59394,7 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58920
59394
|
try {
|
|
58921
59395
|
if (result.ret === 0) {
|
|
58922
59396
|
refreshData();
|
|
59397
|
+
if (isDocDb.value && !props.tableStructure?.columns?.length) emit("refresh-structure");
|
|
58923
59398
|
closeDataEditor();
|
|
58924
59399
|
} else modal.error(t("tableDetail.operationFailed"));
|
|
58925
59400
|
} catch (error) {
|
|
@@ -58952,7 +59427,7 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58952
59427
|
emit("refresh-structure");
|
|
58953
59428
|
emit("refresh-database");
|
|
58954
59429
|
closeTableEditor();
|
|
58955
|
-
|
|
59430
|
+
toast.success(t("tableDetail.structureModifySuccess"));
|
|
58956
59431
|
} else await modal.error(t("tableDetail.structureModifyFailed"));
|
|
58957
59432
|
} catch (error) {
|
|
58958
59433
|
console.error("处理表结构修改失败:", error);
|
|
@@ -58970,19 +59445,64 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
58970
59445
|
function editIndex(index) {
|
|
58971
59446
|
console.log("编辑索引:", index);
|
|
58972
59447
|
}
|
|
58973
|
-
function
|
|
58974
|
-
|
|
58975
|
-
|
|
58976
|
-
|
|
59448
|
+
async function createNewIndex() {
|
|
59449
|
+
indexError.value = "";
|
|
59450
|
+
let keys;
|
|
59451
|
+
try {
|
|
59452
|
+
keys = JSON.parse(newIndexKeys.value);
|
|
59453
|
+
} catch (e) {
|
|
59454
|
+
indexError.value = t("tableDetail.indexKeysInvalidJson", { message: e?.message || e });
|
|
59455
|
+
return;
|
|
59456
|
+
}
|
|
59457
|
+
if (!keys || typeof keys !== "object" || Array.isArray(keys)) {
|
|
59458
|
+
indexError.value = t("tableDetail.indexKeysMustBeObject");
|
|
59459
|
+
return;
|
|
59460
|
+
}
|
|
59461
|
+
try {
|
|
59462
|
+
const res = await databaseService.createIndex(props.connection?.id || "", props.database, props.table?.name || "", keys, {
|
|
59463
|
+
...newIndexName.value.trim() ? { name: newIndexName.value.trim() } : {},
|
|
59464
|
+
unique: newIndexUnique.value
|
|
59465
|
+
});
|
|
59466
|
+
if (res?.ret === 0) {
|
|
59467
|
+
showCreateIndex.value = false;
|
|
59468
|
+
newIndexKeys.value = "{\n \n}";
|
|
59469
|
+
newIndexName.value = "";
|
|
59470
|
+
newIndexUnique.value = false;
|
|
59471
|
+
toast.success(t("tableDetail.indexCreated"));
|
|
59472
|
+
emit("refresh-structure");
|
|
59473
|
+
} else indexError.value = res?.msg || t("tableDetail.indexCreateFailed");
|
|
59474
|
+
} catch (e) {
|
|
59475
|
+
indexError.value = e?.message || String(e);
|
|
59476
|
+
}
|
|
59477
|
+
}
|
|
59478
|
+
async function deleteIndex(index) {
|
|
59479
|
+
if (isDocDb.value && index?.name === "_id_") {
|
|
59480
|
+
await modal.warning(t("tableDetail.primaryIndexUndeletable"));
|
|
59481
|
+
return;
|
|
59482
|
+
}
|
|
59483
|
+
if (!await modal.confirm(t("tableDetail.confirmDeleteIndex", { name: index.name }), {
|
|
59484
|
+
confirmButtonText: t("common.delete"),
|
|
59485
|
+
cancelButtonText: t("common.cancel"),
|
|
58977
59486
|
type: "danger"
|
|
58978
|
-
})
|
|
58979
|
-
|
|
58980
|
-
|
|
59487
|
+
})) return;
|
|
59488
|
+
if (isDocDb.value) {
|
|
59489
|
+
try {
|
|
59490
|
+
const res = await databaseService.dropIndex(props.connection?.id || "", props.database, props.table?.name || "", index.name);
|
|
59491
|
+
if (res?.ret === 0) {
|
|
59492
|
+
toast.success(t("tableDetail.indexDeleted"));
|
|
59493
|
+
emit("refresh-structure");
|
|
59494
|
+
} else await modal.error(res?.msg || t("tableDetail.indexDeleteFailed"));
|
|
59495
|
+
} catch (e) {
|
|
59496
|
+
await modal.error(e?.message || t("tableDetail.indexDeleteFailed"));
|
|
59497
|
+
}
|
|
59498
|
+
return;
|
|
59499
|
+
}
|
|
59500
|
+
emit("refresh-structure");
|
|
58981
59501
|
}
|
|
58982
59502
|
function deleteForeignKey(fk) {
|
|
58983
59503
|
modal.confirm(t("tableDetail.confirmDeleteFK", { name: fk.name }), {
|
|
58984
|
-
confirmButtonText: "
|
|
58985
|
-
cancelButtonText: "
|
|
59504
|
+
confirmButtonText: t("common.delete"),
|
|
59505
|
+
cancelButtonText: t("common.cancel"),
|
|
58986
59506
|
type: "danger"
|
|
58987
59507
|
}).then((result) => {
|
|
58988
59508
|
if (result) emit("refresh-structure");
|
|
@@ -59101,19 +59621,19 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59101
59621
|
}
|
|
59102
59622
|
return (_ctx, _cache) => {
|
|
59103
59623
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
59104
|
-
createBaseVNode("div", _hoisted_2$1, [createBaseVNode("div", _hoisted_3$1, [createBaseVNode("div", _hoisted_4$1, [_cache[
|
|
59624
|
+
createBaseVNode("div", _hoisted_2$1, [createBaseVNode("div", _hoisted_3$1, [createBaseVNode("div", _hoisted_4$1, [_cache[21] || (_cache[21] = createBaseVNode("div", { class: "table-icon" }, [createBaseVNode("i", { class: "bi bi-table" })], -1)), createBaseVNode("div", _hoisted_5$1, [createBaseVNode("h4", _hoisted_6$1, toDisplayString(__props.table?.name), 1), createBaseVNode("div", _hoisted_7$1, [
|
|
59105
59625
|
createBaseVNode("span", {
|
|
59106
59626
|
class: "crumb crumb-link",
|
|
59107
59627
|
onClick: _cache[0] || (_cache[0] = ($event) => emit("navigate-connection")),
|
|
59108
59628
|
title: _ctx.$t("tableDetail.backToConnection")
|
|
59109
|
-
}, [_cache[
|
|
59110
|
-
_cache[
|
|
59629
|
+
}, [_cache[17] || (_cache[17] = createBaseVNode("i", { class: "bi bi-hdd-network me-1" }, null, -1)), createTextVNode(toDisplayString(__props.connection?.name), 1)], 8, _hoisted_8$1),
|
|
59630
|
+
_cache[19] || (_cache[19] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
|
|
59111
59631
|
createBaseVNode("span", {
|
|
59112
59632
|
class: "crumb crumb-link",
|
|
59113
59633
|
onClick: _cache[1] || (_cache[1] = ($event) => emit("navigate-database")),
|
|
59114
59634
|
title: _ctx.$t("tableDetail.backToDatabase")
|
|
59115
|
-
}, [_cache[
|
|
59116
|
-
_cache[
|
|
59635
|
+
}, [_cache[18] || (_cache[18] = createBaseVNode("i", { class: "bi bi-database me-1" }, null, -1)), createTextVNode(toDisplayString(__props.database), 1)], 8, _hoisted_9$1),
|
|
59636
|
+
_cache[20] || (_cache[20] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
|
|
59117
59637
|
createBaseVNode("span", _hoisted_10$1, toDisplayString(__props.table?.name), 1)
|
|
59118
59638
|
])])]), createBaseVNode("div", _hoisted_11$1, [
|
|
59119
59639
|
__props.table?.rowCount !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_12$1, [createBaseVNode("div", _hoisted_13$1, toDisplayString(formatNumber(__props.table?.rowCount)), 1), createBaseVNode("div", _hoisted_14$1, toDisplayString(_ctx.$t("tableDetail.rowData")), 1)])) : createCommentVNode("", true),
|
|
@@ -59125,71 +59645,71 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59125
59645
|
createBaseVNode("button", {
|
|
59126
59646
|
class: "btn btn-primary btn-sm",
|
|
59127
59647
|
onClick: refreshData
|
|
59128
|
-
}, [_cache[
|
|
59129
|
-
|
|
59648
|
+
}, [_cache[22] || (_cache[22] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.refreshData")), 1)]),
|
|
59649
|
+
!isDocDb.value ? (openBlock(), createElementBlock("button", {
|
|
59650
|
+
key: 0,
|
|
59130
59651
|
class: "btn btn-info btn-sm",
|
|
59131
59652
|
onClick: editTableStructure
|
|
59132
|
-
}, [_cache[
|
|
59653
|
+
}, [_cache[23] || (_cache[23] = createBaseVNode("i", { class: "bi bi-pencil-square" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.modifyStructure")), 1)])) : createCommentVNode("", true),
|
|
59133
59654
|
createBaseVNode("button", {
|
|
59134
59655
|
class: "btn btn-success btn-sm",
|
|
59135
59656
|
onClick: _cache[2] || (_cache[2] = () => insertData())
|
|
59136
|
-
}, [_cache[
|
|
59137
|
-
createBaseVNode("div", _hoisted_26$1, [createBaseVNode("button", _hoisted_27$1, [_cache[
|
|
59657
|
+
}, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(isDocDb.value ? _ctx.$t("tableDetail.insertDocument") : _ctx.$t("tableDetail.insertData")), 1)]),
|
|
59658
|
+
createBaseVNode("div", _hoisted_26$1, [createBaseVNode("button", _hoisted_27$1, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-download" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.exportMenu")), 1)]), createBaseVNode("ul", _hoisted_28$1, [
|
|
59138
59659
|
createBaseVNode("li", null, [createBaseVNode("button", {
|
|
59139
59660
|
class: "dropdown-item",
|
|
59140
59661
|
onClick: _cache[3] || (_cache[3] = ($event) => exportTableData("csv"))
|
|
59141
|
-
}, [_cache[
|
|
59662
|
+
}, [_cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-file-earmark-spreadsheet me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportCSV")), 1)])]),
|
|
59142
59663
|
createBaseVNode("li", null, [createBaseVNode("button", {
|
|
59143
59664
|
class: "dropdown-item",
|
|
59144
59665
|
onClick: _cache[4] || (_cache[4] = ($event) => exportTableData("json"))
|
|
59145
|
-
}, [_cache[
|
|
59666
|
+
}, [_cache[27] || (_cache[27] = createBaseVNode("i", { class: "bi bi-file-earmark-code me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportJSON")), 1)])]),
|
|
59146
59667
|
createBaseVNode("li", null, [createBaseVNode("button", {
|
|
59147
59668
|
class: "dropdown-item",
|
|
59148
59669
|
onClick: _cache[5] || (_cache[5] = ($event) => exportTableData("excel"))
|
|
59149
|
-
}, [_cache[
|
|
59150
|
-
_cache[
|
|
59151
|
-
createBaseVNode("li", null, [createBaseVNode("button", {
|
|
59670
|
+
}, [_cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-file-earmark-excel me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportExcel")), 1)])]),
|
|
59671
|
+
!isDocDb.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[30] || (_cache[30] = createBaseVNode("li", null, [createBaseVNode("hr", { class: "dropdown-divider" })], -1)), createBaseVNode("li", null, [createBaseVNode("button", {
|
|
59152
59672
|
class: "dropdown-item",
|
|
59153
59673
|
onClick: _cache[6] || (_cache[6] = ($event) => exportTableStructure())
|
|
59154
|
-
}, [_cache[
|
|
59674
|
+
}, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-file-earmark-text me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportStructure")), 1)])])], 64)) : createCommentVNode("", true),
|
|
59155
59675
|
createBaseVNode("li", null, [createBaseVNode("button", {
|
|
59156
59676
|
class: "dropdown-item",
|
|
59157
59677
|
onClick: _cache[7] || (_cache[7] = ($event) => exportTableDataSQL())
|
|
59158
|
-
}, [_cache[
|
|
59678
|
+
}, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-file-earmark-code me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportDataSQL")), 1)])])
|
|
59159
59679
|
])])
|
|
59160
59680
|
]), createBaseVNode("div", _hoisted_29$1, [__props.table?.rowCount ? (openBlock(), createElementBlock("button", {
|
|
59161
59681
|
key: 0,
|
|
59162
59682
|
class: "btn btn-outline-warning btn-sm",
|
|
59163
59683
|
onClick: truncateTable
|
|
59164
|
-
}, [_cache[
|
|
59684
|
+
}, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.truncateTable")), 1)])) : createCommentVNode("", true), createBaseVNode("button", {
|
|
59165
59685
|
class: "btn btn-outline-danger btn-sm",
|
|
59166
59686
|
onClick: dropTable
|
|
59167
|
-
}, [_cache[
|
|
59687
|
+
}, [_cache[33] || (_cache[33] = createBaseVNode("i", { class: "bi bi-x-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.dropTable")), 1)])])]),
|
|
59168
59688
|
createBaseVNode("div", _hoisted_30$1, [createBaseVNode("ul", _hoisted_31$1, [
|
|
59169
59689
|
createBaseVNode("li", _hoisted_32$1, [createBaseVNode("button", {
|
|
59170
59690
|
class: normalizeClass(["nav-link", { active: activeTab.value === "data" }]),
|
|
59171
59691
|
onClick: _cache[8] || (_cache[8] = ($event) => activeTab.value = "data")
|
|
59172
59692
|
}, [
|
|
59173
|
-
_cache[
|
|
59693
|
+
_cache[34] || (_cache[34] = createBaseVNode("i", { class: "bi bi-grid" }, null, -1)),
|
|
59174
59694
|
createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.dataTab")) + " ", 1),
|
|
59175
59695
|
__props.table?.rowCount ? (openBlock(), createElementBlock("span", _hoisted_33$1, toDisplayString(formatNumber(__props.table?.rowCount)), 1)) : createCommentVNode("", true)
|
|
59176
59696
|
], 2)]),
|
|
59177
59697
|
createBaseVNode("li", _hoisted_34$1, [createBaseVNode("button", {
|
|
59178
59698
|
class: normalizeClass(["nav-link", { active: activeTab.value === "structure" }]),
|
|
59179
59699
|
onClick: _cache[9] || (_cache[9] = ($event) => activeTab.value = "structure")
|
|
59180
|
-
}, [_cache[
|
|
59700
|
+
}, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-diagram-3" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.structureTab")), 1)], 2)]),
|
|
59181
59701
|
createBaseVNode("li", _hoisted_35$1, [createBaseVNode("button", {
|
|
59182
59702
|
class: normalizeClass(["nav-link", { active: activeTab.value === "indexes" }]),
|
|
59183
59703
|
onClick: _cache[10] || (_cache[10] = ($event) => activeTab.value = "indexes")
|
|
59184
|
-
}, [_cache[
|
|
59185
|
-
|
|
59704
|
+
}, [_cache[36] || (_cache[36] = createBaseVNode("i", { class: "bi bi-key" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.indexesTab")), 1)], 2)]),
|
|
59705
|
+
!isDocDb.value ? (openBlock(), createElementBlock("li", _hoisted_36$1, [createBaseVNode("button", {
|
|
59186
59706
|
class: normalizeClass(["nav-link", { active: activeTab.value === "relations" }]),
|
|
59187
59707
|
onClick: _cache[11] || (_cache[11] = ($event) => activeTab.value = "relations")
|
|
59188
|
-
}, [_cache[
|
|
59189
|
-
|
|
59708
|
+
}, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-link-45deg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.relationsTab")), 1)], 2)])) : createCommentVNode("", true),
|
|
59709
|
+
!isDocDb.value ? (openBlock(), createElementBlock("li", _hoisted_37$1, [createBaseVNode("button", {
|
|
59190
59710
|
class: normalizeClass(["nav-link", { active: activeTab.value === "sql" }]),
|
|
59191
59711
|
onClick: _cache[12] || (_cache[12] = ($event) => activeTab.value = "sql")
|
|
59192
|
-
}, [..._cache[
|
|
59712
|
+
}, [..._cache[38] || (_cache[38] = [createBaseVNode("i", { class: "bi bi-code-slash" }, null, -1), createTextVNode(" SQL ", -1)])], 2)])) : createCommentVNode("", true)
|
|
59193
59713
|
]), createBaseVNode("div", _hoisted_38$1, [
|
|
59194
59714
|
withDirectives(createBaseVNode("div", _hoisted_39$1, [createVNode(table_data_grid_default, {
|
|
59195
59715
|
ref_key: "tableDataGridRef",
|
|
@@ -59209,10 +59729,10 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59209
59729
|
withDirectives(createBaseVNode("div", _hoisted_40$1, [createBaseVNode("div", _hoisted_41$1, [createBaseVNode("button", {
|
|
59210
59730
|
class: "btn btn-success btn-sm",
|
|
59211
59731
|
onClick: addColumn
|
|
59212
|
-
}, [_cache[
|
|
59732
|
+
}, [_cache[39] || (_cache[39] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.addColumn")), 1)]), createBaseVNode("button", {
|
|
59213
59733
|
class: "btn btn-info btn-sm",
|
|
59214
59734
|
onClick: editTableStructure
|
|
59215
|
-
}, [_cache[
|
|
59735
|
+
}, [_cache[40] || (_cache[40] = createBaseVNode("i", { class: "bi bi-pencil-square" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.modifyStructure")), 1)])]), createBaseVNode("div", _hoisted_42$1, [createBaseVNode("div", _hoisted_43$1, [createBaseVNode("table", _hoisted_44$1, [createBaseVNode("thead", _hoisted_45$1, [createBaseVNode("tr", null, [
|
|
59216
59736
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.columnNameHeader")), 1),
|
|
59217
59737
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.dataTypeHeader")), 1),
|
|
59218
59738
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.nullableHeader")), 1),
|
|
@@ -59227,45 +59747,75 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59227
59747
|
createBaseVNode("td", null, [createBaseVNode("code", null, toDisplayString(column.type), 1)]),
|
|
59228
59748
|
createBaseVNode("td", null, [createBaseVNode("span", { class: normalizeClass(column.nullable ? "text-warning" : "text-success") }, [createBaseVNode("i", { class: normalizeClass(column.nullable ? "bi bi-unlock" : "bi bi-lock-fill") }, null, 2), createTextVNode(" " + toDisplayString(column.nullable ? "YES" : "NO"), 1)], 2)]),
|
|
59229
59749
|
createBaseVNode("td", null, toDisplayString(column.defaultValue || "-"), 1),
|
|
59230
|
-
createBaseVNode("td", null, [column.isPrimary ? (openBlock(), createElementBlock("span", _hoisted_47, [_cache[
|
|
59231
|
-
createBaseVNode("td", null, [column.isAutoIncrement ? (openBlock(), createElementBlock("span", _hoisted_49, [_cache[
|
|
59750
|
+
createBaseVNode("td", null, [column.isPrimary ? (openBlock(), createElementBlock("span", _hoisted_47$1, [_cache[41] || (_cache[41] = createBaseVNode("i", { class: "bi bi-key-fill" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.primaryKeyHeader")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_48, "-"))]),
|
|
59751
|
+
createBaseVNode("td", null, [column.isAutoIncrement ? (openBlock(), createElementBlock("span", _hoisted_49, [_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-arrow-up-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.autoIncHeader")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_50, "-"))]),
|
|
59232
59752
|
createBaseVNode("td", null, toDisplayString(column.comment || "-"), 1),
|
|
59233
59753
|
createBaseVNode("td", null, [createBaseVNode("button", {
|
|
59234
59754
|
class: "btn btn-outline-primary btn-sm",
|
|
59235
59755
|
title: _ctx.$t("tableDetail.modifyStructure"),
|
|
59236
59756
|
onClick: ($event) => editColumn(column)
|
|
59237
|
-
}, [..._cache[
|
|
59757
|
+
}, [..._cache[43] || (_cache[43] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_51)])
|
|
59238
59758
|
]);
|
|
59239
59759
|
}), 128))])])])])], 512), [[vShow, activeTab.value === "structure"]]),
|
|
59240
|
-
withDirectives(createBaseVNode("div", _hoisted_52, [createBaseVNode("div", _hoisted_53, [
|
|
59241
|
-
|
|
59242
|
-
|
|
59243
|
-
|
|
59244
|
-
createBaseVNode("
|
|
59245
|
-
|
|
59246
|
-
|
|
59247
|
-
|
|
59248
|
-
|
|
59249
|
-
|
|
59250
|
-
|
|
59251
|
-
|
|
59252
|
-
|
|
59253
|
-
|
|
59254
|
-
|
|
59255
|
-
|
|
59256
|
-
|
|
59257
|
-
|
|
59258
|
-
|
|
59259
|
-
|
|
59260
|
-
|
|
59261
|
-
|
|
59760
|
+
withDirectives(createBaseVNode("div", _hoisted_52, [createBaseVNode("div", _hoisted_53, [
|
|
59761
|
+
isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_54, [createBaseVNode("button", {
|
|
59762
|
+
class: "btn btn-success btn-sm",
|
|
59763
|
+
onClick: _cache[13] || (_cache[13] = ($event) => showCreateIndex.value = !showCreateIndex.value)
|
|
59764
|
+
}, [_cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.createIndex")), 1)])])) : createCommentVNode("", true),
|
|
59765
|
+
isDocDb.value && showCreateIndex.value ? (openBlock(), createElementBlock("div", _hoisted_55, [createBaseVNode("div", _hoisted_56, [
|
|
59766
|
+
createBaseVNode("div", _hoisted_57, [createBaseVNode("label", _hoisted_58, toDisplayString(_ctx.$t("tableDetail.indexKeysLabel")), 1), withDirectives(createBaseVNode("textarea", {
|
|
59767
|
+
class: "form-control font-monospace",
|
|
59768
|
+
rows: "3",
|
|
59769
|
+
"onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => newIndexKeys.value = $event),
|
|
59770
|
+
spellcheck: "false",
|
|
59771
|
+
placeholder: "{\"name\": 1}"
|
|
59772
|
+
}, null, 512), [[vModelText, newIndexKeys.value]])]),
|
|
59773
|
+
createBaseVNode("div", _hoisted_59, [createBaseVNode("label", _hoisted_60, toDisplayString(_ctx.$t("tableDetail.indexNameOptional")), 1), withDirectives(createBaseVNode("input", {
|
|
59774
|
+
class: "form-control form-control-sm",
|
|
59775
|
+
"onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => newIndexName.value = $event),
|
|
59776
|
+
placeholder: "idx_name"
|
|
59777
|
+
}, null, 512), [[vModelText, newIndexName.value]])]),
|
|
59778
|
+
createBaseVNode("div", _hoisted_61, [createBaseVNode("div", _hoisted_62, [withDirectives(createBaseVNode("input", {
|
|
59779
|
+
class: "form-check-input",
|
|
59780
|
+
type: "checkbox",
|
|
59781
|
+
id: "uniqIdx",
|
|
59782
|
+
"onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => newIndexUnique.value = $event)
|
|
59783
|
+
}, null, 512), [[vModelCheckbox, newIndexUnique.value]]), createBaseVNode("label", _hoisted_63, toDisplayString(_ctx.$t("tableDetail.uniqueHeader")), 1)])]),
|
|
59784
|
+
createBaseVNode("div", _hoisted_64, [createBaseVNode("button", {
|
|
59785
|
+
class: "btn btn-primary btn-sm",
|
|
59786
|
+
onClick: createNewIndex
|
|
59787
|
+
}, toDisplayString(_ctx.$t("common.create")), 1)])
|
|
59788
|
+
]), indexError.value ? (openBlock(), createElementBlock("div", _hoisted_65, toDisplayString(indexError.value), 1)) : createCommentVNode("", true)])) : createCommentVNode("", true),
|
|
59789
|
+
createBaseVNode("div", _hoisted_66, [createBaseVNode("table", _hoisted_67, [createBaseVNode("thead", _hoisted_68, [createBaseVNode("tr", null, [
|
|
59790
|
+
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.indexNameHeader")), 1),
|
|
59791
|
+
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.typeHeader")), 1),
|
|
59792
|
+
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.uniqueHeader")), 1),
|
|
59793
|
+
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.columnsHeader")), 1),
|
|
59794
|
+
createBaseVNode("th", _hoisted_69, toDisplayString(_ctx.$t("tableDetail.operationsHeader")), 1)
|
|
59795
|
+
])]), createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tableStructure?.indexes || [], (index) => {
|
|
59796
|
+
return openBlock(), createElementBlock("tr", { key: index.name }, [
|
|
59797
|
+
createBaseVNode("td", null, [createBaseVNode("strong", null, toDisplayString(index.name), 1)]),
|
|
59798
|
+
createBaseVNode("td", null, [createBaseVNode("span", _hoisted_70, toDisplayString(index.type), 1)]),
|
|
59799
|
+
createBaseVNode("td", null, [createBaseVNode("span", { class: normalizeClass(index.unique ? "text-success" : "text-secondary") }, [createBaseVNode("i", { class: normalizeClass(index.unique ? "bi bi-check-circle-fill" : "bi bi-circle") }, null, 2), createTextVNode(" " + toDisplayString(index.unique ? _ctx.$t("common.yes") : _ctx.$t("common.no")), 1)], 2)]),
|
|
59800
|
+
createBaseVNode("td", null, [createBaseVNode("code", null, toDisplayString(index.columns.join(", ")), 1)]),
|
|
59801
|
+
createBaseVNode("td", null, [createBaseVNode("div", _hoisted_71, [createBaseVNode("button", {
|
|
59802
|
+
class: "btn btn-outline-primary btn-sm",
|
|
59803
|
+
onClick: ($event) => editIndex(index)
|
|
59804
|
+
}, [..._cache[45] || (_cache[45] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_72), createBaseVNode("button", {
|
|
59805
|
+
class: "btn btn-outline-danger btn-sm",
|
|
59806
|
+
onClick: ($event) => deleteIndex(index)
|
|
59807
|
+
}, [..._cache[46] || (_cache[46] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_73)])])
|
|
59808
|
+
]);
|
|
59809
|
+
}), 128))])])])
|
|
59810
|
+
])], 512), [[vShow, activeTab.value === "indexes"]]),
|
|
59811
|
+
activeTab.value === "relations" && !isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_74, [createBaseVNode("div", _hoisted_75, [createBaseVNode("div", _hoisted_76, [createBaseVNode("table", _hoisted_77, [createBaseVNode("thead", _hoisted_78, [createBaseVNode("tr", null, [
|
|
59262
59812
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.constraintNameHeader")), 1),
|
|
59263
59813
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.localColumnHeader")), 1),
|
|
59264
59814
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.targetTableHeader")), 1),
|
|
59265
59815
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.targetColumnHeader")), 1),
|
|
59266
59816
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.onDeleteHeader")), 1),
|
|
59267
59817
|
createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.onUpdateHeader")), 1),
|
|
59268
|
-
createBaseVNode("th",
|
|
59818
|
+
createBaseVNode("th", _hoisted_79, toDisplayString(_ctx.$t("tableDetail.operationsHeader")), 1)
|
|
59269
59819
|
])]), createBaseVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.tableStructure?.foreignKeys || [], (fk) => {
|
|
59270
59820
|
return openBlock(), createElementBlock("tr", { key: fk.name }, [
|
|
59271
59821
|
createBaseVNode("td", null, [createBaseVNode("strong", null, toDisplayString(fk.name), 1)]),
|
|
@@ -59274,16 +59824,16 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59274
59824
|
createBaseVNode("td", null, [createBaseVNode("code", null, toDisplayString(fk.referencedColumn), 1)]),
|
|
59275
59825
|
createBaseVNode("td", null, toDisplayString(fk.onDelete || "-"), 1),
|
|
59276
59826
|
createBaseVNode("td", null, toDisplayString(fk.onUpdate || "-"), 1),
|
|
59277
|
-
createBaseVNode("td", null, [createBaseVNode("div",
|
|
59827
|
+
createBaseVNode("td", null, [createBaseVNode("div", _hoisted_80, [createBaseVNode("button", {
|
|
59278
59828
|
class: "btn btn-outline-danger btn-sm",
|
|
59279
59829
|
onClick: ($event) => deleteForeignKey(fk)
|
|
59280
|
-
}, [..._cache[
|
|
59830
|
+
}, [..._cache[47] || (_cache[47] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_81)])])
|
|
59281
59831
|
]);
|
|
59282
|
-
}), 128))])])])])]
|
|
59283
|
-
|
|
59832
|
+
}), 128))])])])])])) : createCommentVNode("", true),
|
|
59833
|
+
activeTab.value === "sql" && !isDocDb.value ? (openBlock(), createElementBlock("div", _hoisted_82, [createBaseVNode("div", _hoisted_83, [createVNode(sql_executor_default, {
|
|
59284
59834
|
connection: __props.connection,
|
|
59285
59835
|
database: __props.database
|
|
59286
|
-
}, null, 8, ["connection", "database"])])]
|
|
59836
|
+
}, null, 8, ["connection", "database"])])])) : createCommentVNode("", true)
|
|
59287
59837
|
])]),
|
|
59288
59838
|
createVNode(data_editor_default, {
|
|
59289
59839
|
visible: showDataEditor.value,
|
|
@@ -59327,17 +59877,17 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59327
59877
|
});
|
|
59328
59878
|
}));
|
|
59329
59879
|
//#endregion
|
|
59330
|
-
//#region src/platform/database/components/table-detail.vue?vue&type=style&index=0&scoped=
|
|
59331
|
-
var
|
|
59880
|
+
//#region src/platform/database/components/table-detail.vue?vue&type=style&index=0&scoped=ee741fc9&lang.css
|
|
59881
|
+
var init_table_detail_vue_vue_type_style_index_0_scoped_ee741fc9_lang = __esmMin((() => {}));
|
|
59332
59882
|
//#endregion
|
|
59333
59883
|
//#region src/platform/database/components/table-detail.vue
|
|
59334
59884
|
var table_detail_default;
|
|
59335
59885
|
var init_table_detail = __esmMin((() => {
|
|
59336
59886
|
init_table_detail_vue_vue_type_script_setup_true_lang();
|
|
59337
59887
|
init_table_detail_vue_vue_type_script_setup_true_lang();
|
|
59338
|
-
|
|
59888
|
+
init_table_detail_vue_vue_type_style_index_0_scoped_ee741fc9_lang();
|
|
59339
59889
|
init__plugin_vue_export_helper();
|
|
59340
|
-
table_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
59890
|
+
table_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ee741fc9"]]);
|
|
59341
59891
|
}));
|
|
59342
59892
|
//#endregion
|
|
59343
59893
|
//#region src/platform/database/utils/table.ts
|
|
@@ -59360,10 +59910,11 @@ function pickTables(list) {
|
|
|
59360
59910
|
var init_table = __esmMin((() => {}));
|
|
59361
59911
|
//#endregion
|
|
59362
59912
|
//#region src/platform/database/explorer.vue?vue&type=script&setup=true&lang.ts
|
|
59363
|
-
var _hoisted_1, _hoisted_2, _hoisted_3, _hoisted_4, _hoisted_5, _hoisted_6, _hoisted_7, _hoisted_8, _hoisted_9, _hoisted_10, _hoisted_11, _hoisted_12, _hoisted_13, _hoisted_14, _hoisted_15, _hoisted_16, _hoisted_17, _hoisted_18, _hoisted_19, _hoisted_20, _hoisted_21, _hoisted_22, _hoisted_23, _hoisted_24, _hoisted_25, _hoisted_26, _hoisted_27, _hoisted_28, _hoisted_29, _hoisted_30, _hoisted_31, _hoisted_32, _hoisted_33, _hoisted_34, _hoisted_35, _hoisted_36, _hoisted_37, _hoisted_38, _hoisted_39, _hoisted_40, _hoisted_41, _hoisted_42, _hoisted_43, _hoisted_44, _hoisted_45, _hoisted_46, explorer_vue_vue_type_script_setup_true_lang_default;
|
|
59913
|
+
var _hoisted_1, _hoisted_2, _hoisted_3, _hoisted_4, _hoisted_5, _hoisted_6, _hoisted_7, _hoisted_8, _hoisted_9, _hoisted_10, _hoisted_11, _hoisted_12, _hoisted_13, _hoisted_14, _hoisted_15, _hoisted_16, _hoisted_17, _hoisted_18, _hoisted_19, _hoisted_20, _hoisted_21, _hoisted_22, _hoisted_23, _hoisted_24, _hoisted_25, _hoisted_26, _hoisted_27, _hoisted_28, _hoisted_29, _hoisted_30, _hoisted_31, _hoisted_32, _hoisted_33, _hoisted_34, _hoisted_35, _hoisted_36, _hoisted_37, _hoisted_38, _hoisted_39, _hoisted_40, _hoisted_41, _hoisted_42, _hoisted_43, _hoisted_44, _hoisted_45, _hoisted_46, _hoisted_47, explorer_vue_vue_type_script_setup_true_lang_default;
|
|
59364
59914
|
var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
59365
59915
|
init_vue_runtime_esm_bundler();
|
|
59366
59916
|
init_vue_router();
|
|
59917
|
+
init_vue_i18n();
|
|
59367
59918
|
init_database();
|
|
59368
59919
|
init_connection_editor();
|
|
59369
59920
|
init_toast$1();
|
|
@@ -59372,6 +59923,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59372
59923
|
init_database_detail();
|
|
59373
59924
|
init_table_detail();
|
|
59374
59925
|
init_table();
|
|
59926
|
+
init_database_types$1();
|
|
59375
59927
|
init_modal();
|
|
59376
59928
|
_hoisted_1 = { class: "database-explorer" };
|
|
59377
59929
|
_hoisted_2 = { class: "explorer-layout" };
|
|
@@ -59420,31 +59972,36 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59420
59972
|
class: "tree-children"
|
|
59421
59973
|
};
|
|
59422
59974
|
_hoisted_35 = { class: "node-content table-content" };
|
|
59423
|
-
_hoisted_36 =
|
|
59424
|
-
_hoisted_37 =
|
|
59425
|
-
_hoisted_38 = { class: "
|
|
59426
|
-
_hoisted_39 = {
|
|
59975
|
+
_hoisted_36 = { class: "node-icon" };
|
|
59976
|
+
_hoisted_37 = ["onClick"];
|
|
59977
|
+
_hoisted_38 = { class: "node-label" };
|
|
59978
|
+
_hoisted_39 = { class: "table-name" };
|
|
59979
|
+
_hoisted_40 = {
|
|
59427
59980
|
key: 0,
|
|
59428
59981
|
class: "table-info"
|
|
59429
59982
|
};
|
|
59430
|
-
|
|
59431
|
-
|
|
59432
|
-
|
|
59983
|
+
_hoisted_41 = { class: "node-actions" };
|
|
59984
|
+
_hoisted_42 = ["onClick", "title"];
|
|
59985
|
+
_hoisted_43 = {
|
|
59433
59986
|
key: 0,
|
|
59434
59987
|
class: "empty-state"
|
|
59435
59988
|
};
|
|
59436
|
-
|
|
59437
|
-
|
|
59438
|
-
|
|
59989
|
+
_hoisted_44 = { class: "empty-text" };
|
|
59990
|
+
_hoisted_45 = { class: "explorer-main" };
|
|
59991
|
+
_hoisted_46 = {
|
|
59439
59992
|
key: 3,
|
|
59440
59993
|
class: "default-state"
|
|
59441
59994
|
};
|
|
59442
|
-
|
|
59995
|
+
_hoisted_47 = { class: "default-content" };
|
|
59443
59996
|
explorer_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
59444
59997
|
__name: "explorer",
|
|
59445
59998
|
setup(__props) {
|
|
59999
|
+
function isDocDb(connection) {
|
|
60000
|
+
return isDocumentDb(connection?.type);
|
|
60001
|
+
}
|
|
59446
60002
|
const route = useRoute();
|
|
59447
60003
|
const router = useRouter();
|
|
60004
|
+
const { t } = useI18n();
|
|
59448
60005
|
const connectionService = new ConnectionService();
|
|
59449
60006
|
const databaseService = new DatabaseService();
|
|
59450
60007
|
const connections = ref([]);
|
|
@@ -59472,7 +60029,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59472
60029
|
const sqlResult = ref(null);
|
|
59473
60030
|
const sqlExecuting = ref(false);
|
|
59474
60031
|
const isGlobalLoading = ref(false);
|
|
59475
|
-
const loadingMessage = ref("
|
|
60032
|
+
const loadingMessage = ref("");
|
|
59476
60033
|
const connectionEditorRef = ref();
|
|
59477
60034
|
const toastRef = ref();
|
|
59478
60035
|
const databaseInfo = computed(() => {
|
|
@@ -59534,7 +60091,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59534
60091
|
connections.value = response?.data || [];
|
|
59535
60092
|
} catch (error) {
|
|
59536
60093
|
console.error("加载连接失败:", error);
|
|
59537
|
-
modal.error(error.msg || error.message || "
|
|
60094
|
+
modal.error(error.msg || error.message || t("explorer.loadConnectionsFailed"), {
|
|
59538
60095
|
operation: "LOAD_CONNECTIONS",
|
|
59539
60096
|
stack: error.stack
|
|
59540
60097
|
});
|
|
@@ -59571,7 +60128,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59571
60128
|
databaseCache.value = newCache;
|
|
59572
60129
|
} catch (error) {
|
|
59573
60130
|
console.error("加载数据库失败:", error);
|
|
59574
|
-
modal.error(error.msg || error.message || "
|
|
60131
|
+
modal.error(error.msg || error.message || t("explorer.loadDatabasesFailed"), {
|
|
59575
60132
|
operation: "LOAD_DATABASES",
|
|
59576
60133
|
connectionId: connection.id,
|
|
59577
60134
|
stack: error.stack
|
|
@@ -59621,7 +60178,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59621
60178
|
tableCache.value = newCache;
|
|
59622
60179
|
} catch (error) {
|
|
59623
60180
|
console.error("加载表失败:", error);
|
|
59624
|
-
modal.error(error.msg || error.message || "
|
|
60181
|
+
modal.error(error.msg || error.message || t("explorer.loadTablesFailed"), {
|
|
59625
60182
|
operation: "LOAD_TABLES",
|
|
59626
60183
|
database,
|
|
59627
60184
|
stack: error.stack
|
|
@@ -59645,7 +60202,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59645
60202
|
loadTablesForDatabase(connection, database, forceRefresh);
|
|
59646
60203
|
} catch (error) {
|
|
59647
60204
|
console.error("加载数据库信息失败:", error);
|
|
59648
|
-
modal.error(error.msg || error.message || "
|
|
60205
|
+
modal.error(error.msg || error.message || t("explorer.loadDatabaseInfoFailed"), {
|
|
59649
60206
|
operation: "LOAD_DATABASE_INFO",
|
|
59650
60207
|
database,
|
|
59651
60208
|
stack: error.stack
|
|
@@ -59684,7 +60241,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59684
60241
|
async function loadTableData(connection, database, tableName, page = 1, pageSize = 50, searchQuery) {
|
|
59685
60242
|
try {
|
|
59686
60243
|
isGlobalLoading.value = true;
|
|
59687
|
-
loadingMessage.value =
|
|
60244
|
+
loadingMessage.value = t("explorer.loadingTableData", { name: tableName });
|
|
59688
60245
|
let whereClause = "";
|
|
59689
60246
|
if (searchQuery && searchQuery.trim()) {
|
|
59690
60247
|
const searchTerm = searchQuery.trim();
|
|
@@ -59707,7 +60264,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59707
60264
|
currentPage.value = page;
|
|
59708
60265
|
} catch (error) {
|
|
59709
60266
|
console.error("加载表数据失败:", error);
|
|
59710
|
-
modal.error(error.msg || error.message || "
|
|
60267
|
+
modal.error(error.msg || error.message || t("explorer.loadTableDataFailed"), {
|
|
59711
60268
|
operation: "LOAD_TABLE_DATA",
|
|
59712
60269
|
table: tableName,
|
|
59713
60270
|
stack: error.stack
|
|
@@ -59724,7 +60281,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59724
60281
|
tableColumns.value = structure?.data.columns || [];
|
|
59725
60282
|
} catch (error) {
|
|
59726
60283
|
console.error("加载表结构失败:", error);
|
|
59727
|
-
modal.error(error.msg || error.message || "
|
|
60284
|
+
modal.error(error.msg || error.message || t("explorer.loadTableStructureFailed"), {
|
|
59728
60285
|
operation: "LOAD_TABLE_STRUCTURE",
|
|
59729
60286
|
table: tableName,
|
|
59730
60287
|
stack: error.stack
|
|
@@ -59751,10 +60308,10 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59751
60308
|
async function testConnection(connection) {
|
|
59752
60309
|
try {
|
|
59753
60310
|
const result = await connectionService.testConnection(connection);
|
|
59754
|
-
if (result.ret === 0 && result.data) showToast("",
|
|
59755
|
-
else showToast("",
|
|
60311
|
+
if (result.ret === 0 && result.data) showToast("", t("explorer.testConnectionSuccess", { name: connection.name }), "success");
|
|
60312
|
+
else showToast("", t("explorer.testConnectionFailed", { name: connection.name }), "error");
|
|
59756
60313
|
} catch (error) {
|
|
59757
|
-
modal.error(error.msg || error.message || "
|
|
60314
|
+
modal.error(error.msg || error.message || t("explorer.testConnectionError"), {
|
|
59758
60315
|
operation: "TEST_CONNECTION",
|
|
59759
60316
|
connectionId: connection.id,
|
|
59760
60317
|
stack: error.stack
|
|
@@ -59783,7 +60340,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59783
60340
|
}
|
|
59784
60341
|
}
|
|
59785
60342
|
function handleOpenSqlQuery(connection) {
|
|
59786
|
-
showToast("
|
|
60343
|
+
showToast(t("common.tip"), t("explorer.sqlQueryInDev"), "info");
|
|
59787
60344
|
}
|
|
59788
60345
|
function refreshAll() {
|
|
59789
60346
|
databaseCache.value.clear();
|
|
@@ -59797,7 +60354,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59797
60354
|
async function handleRefreshStructure() {
|
|
59798
60355
|
if (selectedConnection.value && selectedDatabase.value && selectedTable.value) {
|
|
59799
60356
|
await loadTableStructure(selectedConnection.value, selectedDatabase.value, selectedTable.value.name);
|
|
59800
|
-
showToast("", "
|
|
60357
|
+
showToast("", t("explorer.tableStructureRefreshed"), "success");
|
|
59801
60358
|
}
|
|
59802
60359
|
}
|
|
59803
60360
|
function getDbTypeLabel(type) {
|
|
@@ -59807,7 +60364,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59807
60364
|
sqlite: "SQLite",
|
|
59808
60365
|
mssql: "SQL Server",
|
|
59809
60366
|
oracle: "Oracle",
|
|
59810
|
-
remote: "
|
|
60367
|
+
remote: t("connection.typeRemote")
|
|
59811
60368
|
}[type] || type;
|
|
59812
60369
|
}
|
|
59813
60370
|
function getDbLogoClass(type) {
|
|
@@ -59835,7 +60392,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59835
60392
|
async function refreshConnection(connection) {
|
|
59836
60393
|
databaseCache.value.delete(connection.id);
|
|
59837
60394
|
if (expandedConnections.value.has(connection.id)) await loadDatabasesForConnection(connection, true);
|
|
59838
|
-
showToast("",
|
|
60395
|
+
showToast("", t("explorer.connectionRefreshed", { name: connection.name }), "success");
|
|
59839
60396
|
}
|
|
59840
60397
|
async function refreshDatabase(connection, database) {
|
|
59841
60398
|
const dbKey = `${connection.id}-${database}`;
|
|
@@ -59849,16 +60406,16 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59849
60406
|
expandedDatabases.value.add(dbKey);
|
|
59850
60407
|
await loadDatabaseInfo(connection, database);
|
|
59851
60408
|
}
|
|
59852
|
-
showToast("",
|
|
60409
|
+
showToast("", t("explorer.databaseRefreshed", { name: database }), "success");
|
|
59853
60410
|
}
|
|
59854
60411
|
async function deleteDatabase(connection, database) {
|
|
59855
|
-
if (await modal.confirm(
|
|
60412
|
+
if (await modal.confirm(t("explorer.confirmDeleteDatabase", { name: database }))) try {
|
|
59856
60413
|
isGlobalLoading.value = true;
|
|
59857
|
-
loadingMessage.value =
|
|
60414
|
+
loadingMessage.value = t("explorer.deletingDatabase", { name: database });
|
|
59858
60415
|
const deleteSql = `DROP DATABASE \`${database}\``;
|
|
59859
60416
|
const result = await databaseService.executeQuery(connection.id, deleteSql);
|
|
59860
60417
|
if (result.ret === 0) {
|
|
59861
|
-
showToast("
|
|
60418
|
+
showToast(t("common.success"), t("explorer.databaseDeleted", { name: database }), "success");
|
|
59862
60419
|
const connectionId = connection.id || "";
|
|
59863
60420
|
const databases = databaseCache.value.get(connectionId) || [];
|
|
59864
60421
|
databaseCache.value.set(connectionId, databases.filter((db) => db !== database));
|
|
@@ -59869,10 +60426,10 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59869
60426
|
const dbKey = `${connection.id}-${database}`;
|
|
59870
60427
|
tableCache.value.delete(dbKey);
|
|
59871
60428
|
databaseInfoCache.value.delete(dbKey);
|
|
59872
|
-
} else showToast("
|
|
60429
|
+
} else showToast(t("common.error"), `${t("explorer.deleteDatabaseFailed")}: ${result.error}`, "error");
|
|
59873
60430
|
} catch (error) {
|
|
59874
60431
|
console.error("删除数据库失败:", error);
|
|
59875
|
-
modal.error(error.msg || error.message || "
|
|
60432
|
+
modal.error(error.msg || error.message || t("explorer.deleteDatabaseFailed"), {
|
|
59876
60433
|
operation: "DELETE_DATABASE",
|
|
59877
60434
|
database,
|
|
59878
60435
|
stack: error.stack
|
|
@@ -59882,11 +60439,11 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59882
60439
|
}
|
|
59883
60440
|
}
|
|
59884
60441
|
async function deleteConnection(connection) {
|
|
59885
|
-
if (await modal.confirm(
|
|
60442
|
+
if (await modal.confirm(t("explorer.confirmDeleteConnection", { name: connection.name }))) try {
|
|
59886
60443
|
isGlobalLoading.value = true;
|
|
59887
|
-
loadingMessage.value =
|
|
60444
|
+
loadingMessage.value = t("explorer.deletingConnection", { name: connection.name });
|
|
59888
60445
|
await connectionService.deleteConnection(connection.id || "");
|
|
59889
|
-
showToast("
|
|
60446
|
+
showToast(t("common.success"), t("explorer.connectionDeleted", { name: connection.name }), "success");
|
|
59890
60447
|
const index = connections.value.findIndex((conn) => conn.id === connection.id);
|
|
59891
60448
|
if (index !== -1) connections.value.splice(index, 1);
|
|
59892
60449
|
databaseCache.value.delete(connection.id);
|
|
@@ -59900,7 +60457,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59900
60457
|
}
|
|
59901
60458
|
} catch (error) {
|
|
59902
60459
|
console.error("删除连接失败:", error);
|
|
59903
|
-
modal.error(error.msg || error.message || "
|
|
60460
|
+
modal.error(error.msg || error.message || t("explorer.deleteConnectionFailed"), {
|
|
59904
60461
|
operation: "DELETE_CONNECTION",
|
|
59905
60462
|
connectionId: connection.id,
|
|
59906
60463
|
stack: error.stack
|
|
@@ -59914,7 +60471,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59914
60471
|
await loadTableData(connection, database, table.name);
|
|
59915
60472
|
await loadTableStructure(connection, database, table.name);
|
|
59916
60473
|
}
|
|
59917
|
-
showToast("",
|
|
60474
|
+
showToast("", t("explorer.tableRefreshed", { name: table.name }), "success");
|
|
59918
60475
|
}
|
|
59919
60476
|
function handleRefreshDatabase() {
|
|
59920
60477
|
if (selectedConnection.value && selectedDatabase.value) refreshDatabase(selectedConnection.value, selectedDatabase.value);
|
|
@@ -59922,13 +60479,13 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59922
60479
|
async function handleCreateTable(tableData) {
|
|
59923
60480
|
try {
|
|
59924
60481
|
isGlobalLoading.value = true;
|
|
59925
|
-
loadingMessage.value =
|
|
60482
|
+
loadingMessage.value = t("explorer.creatingTable", { name: tableData.name });
|
|
59926
60483
|
console.log("创建表:", tableData);
|
|
59927
60484
|
await handleRefreshDatabase();
|
|
59928
|
-
showToast("
|
|
60485
|
+
showToast(t("common.success"), t("explorer.tableCreated", { name: tableData.name }), "success");
|
|
59929
60486
|
} catch (error) {
|
|
59930
60487
|
console.error("创建表失败:", error);
|
|
59931
|
-
modal.error(error.msg || error.message || "
|
|
60488
|
+
modal.error(error.msg || error.message || t("explorer.createTableFailed"), {
|
|
59932
60489
|
operation: "CREATE_TABLE",
|
|
59933
60490
|
stack: error.stack
|
|
59934
60491
|
});
|
|
@@ -59937,22 +60494,22 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59937
60494
|
}
|
|
59938
60495
|
}
|
|
59939
60496
|
function handleInsertData() {
|
|
59940
|
-
showToast("
|
|
60497
|
+
showToast(t("common.tip"), t("explorer.insertDataInDev"), "info");
|
|
59941
60498
|
}
|
|
59942
60499
|
function handleExportTable() {
|
|
59943
|
-
showToast("
|
|
60500
|
+
showToast(t("common.tip"), t("explorer.exportTableInDev"), "info");
|
|
59944
60501
|
}
|
|
59945
60502
|
async function handleTruncateTable() {
|
|
59946
60503
|
if (!selectedTable.value || !selectedConnection.value || !selectedDatabase.value) return;
|
|
59947
|
-
if (await modal.confirm(
|
|
60504
|
+
if (await modal.confirm(t("explorer.confirmTruncateTable", { name: selectedTable.value.name }))) try {
|
|
59948
60505
|
isGlobalLoading.value = true;
|
|
59949
|
-
loadingMessage.value =
|
|
60506
|
+
loadingMessage.value = t("explorer.truncatingTable", { name: selectedTable.value.name });
|
|
59950
60507
|
console.log("清空表:", selectedTable.value.name);
|
|
59951
60508
|
await refreshTableData();
|
|
59952
|
-
showToast("
|
|
60509
|
+
showToast(t("common.success"), t("explorer.tableTruncated", { name: selectedTable.value.name }), "success");
|
|
59953
60510
|
} catch (error) {
|
|
59954
60511
|
console.error("清空表失败:", error);
|
|
59955
|
-
modal.error(error.msg || error.message || "
|
|
60512
|
+
modal.error(error.msg || error.message || t("explorer.truncateTableFailed"), {
|
|
59956
60513
|
operation: "TRUNCATE_TABLE",
|
|
59957
60514
|
stack: error.stack
|
|
59958
60515
|
});
|
|
@@ -59961,18 +60518,18 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59961
60518
|
}
|
|
59962
60519
|
}
|
|
59963
60520
|
function handleEditRow(row) {
|
|
59964
|
-
showToast("
|
|
60521
|
+
showToast(t("common.tip"), t("explorer.editRowInDev"), "info");
|
|
59965
60522
|
}
|
|
59966
60523
|
function handleDeleteRow(row) {
|
|
59967
|
-
showToast("
|
|
60524
|
+
showToast(t("common.tip"), t("explorer.deleteRowInDev"), "info");
|
|
59968
60525
|
}
|
|
59969
60526
|
async function handleExecuteSql(sql) {
|
|
59970
60527
|
if (!selectedConnection.value) {
|
|
59971
|
-
showToast("
|
|
60528
|
+
showToast(t("common.error"), t("explorer.selectConnectionFirst"), "error");
|
|
59972
60529
|
return;
|
|
59973
60530
|
}
|
|
59974
60531
|
if (!sql.trim()) {
|
|
59975
|
-
showToast("
|
|
60532
|
+
showToast(t("common.error"), t("explorer.sqlCannotBeEmpty"), "error");
|
|
59976
60533
|
return;
|
|
59977
60534
|
}
|
|
59978
60535
|
try {
|
|
@@ -59981,7 +60538,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59981
60538
|
const databaseName = selectedTable.value ? selectedDatabase.value : selectedDatabase.value;
|
|
59982
60539
|
const result = await databaseService.executeQuery(selectedConnection.value.id, sql, databaseName);
|
|
59983
60540
|
if (result.ret === 0 && result.data) {
|
|
59984
|
-
showToast("", "
|
|
60541
|
+
showToast("", t("explorer.sqlExecuted"), "success");
|
|
59985
60542
|
if (result.data && Array.isArray(result.data)) sqlResult.value = {
|
|
59986
60543
|
success: true,
|
|
59987
60544
|
data: result.data,
|
|
@@ -59997,7 +60554,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
59997
60554
|
affectedRows: result.data.affectedRows || 0,
|
|
59998
60555
|
insertId: result.data.insertId || null
|
|
59999
60556
|
};
|
|
60000
|
-
showToast("",
|
|
60557
|
+
showToast("", t("explorer.sqlAffectedRows", { count: result.data.affectedRows || 0 }), "success");
|
|
60001
60558
|
}
|
|
60002
60559
|
} else {
|
|
60003
60560
|
sqlResult.value = {
|
|
@@ -60007,7 +60564,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
60007
60564
|
affectedRows: 0,
|
|
60008
60565
|
error: result.error
|
|
60009
60566
|
};
|
|
60010
|
-
showToast("
|
|
60567
|
+
showToast(t("common.error"), `${t("explorer.sqlExecuteFailed")}: ${result.error}`, "error");
|
|
60011
60568
|
}
|
|
60012
60569
|
} catch (error) {
|
|
60013
60570
|
console.error("SQL执行失败:", error);
|
|
@@ -60018,7 +60575,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
60018
60575
|
affectedRows: 0,
|
|
60019
60576
|
error: error?.message || ""
|
|
60020
60577
|
};
|
|
60021
|
-
modal.error(error.msg || error.message || "
|
|
60578
|
+
modal.error(error.msg || error.message || t("explorer.sqlExecuteFailed"), {
|
|
60022
60579
|
operation: "EXECUTE_SQL",
|
|
60023
60580
|
sql,
|
|
60024
60581
|
stack: error.stack
|
|
@@ -60104,23 +60661,23 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
60104
60661
|
key: `${connection.id}-${database}-${table.name}`,
|
|
60105
60662
|
class: normalizeClass(["tree-node table-node", { "selected": selectedTable.value?.name === table.name && selectedDatabase.value === database && selectedConnection.value?.id === connection.id }])
|
|
60106
60663
|
}, [createBaseVNode("div", _hoisted_35, [
|
|
60107
|
-
|
|
60664
|
+
createBaseVNode("div", _hoisted_36, [createBaseVNode("i", { class: normalizeClass(isDocDb(connection) ? "bi bi-collection" : "bi bi-table") }, null, 2)]),
|
|
60108
60665
|
createBaseVNode("div", {
|
|
60109
60666
|
class: "node-main",
|
|
60110
60667
|
onClick: ($event) => selectTable(connection, database, table)
|
|
60111
|
-
}, [createBaseVNode("div",
|
|
60112
|
-
createBaseVNode("div",
|
|
60668
|
+
}, [createBaseVNode("div", _hoisted_38, [createBaseVNode("span", _hoisted_39, toDisplayString(table.name), 1), table.rowCount !== void 0 ? (openBlock(), createElementBlock("span", _hoisted_40, toDisplayString(formatNumber(table.rowCount)) + " " + toDisplayString(isDocDb(connection) ? _ctx.$t("explorer.docsSuffix") : _ctx.$t("explorer.rowsSuffix")), 1)) : createCommentVNode("", true)])], 8, _hoisted_37),
|
|
60669
|
+
createBaseVNode("div", _hoisted_41, [createBaseVNode("button", {
|
|
60113
60670
|
class: "btn btn-sm btn-icon",
|
|
60114
60671
|
onClick: withModifiers(($event) => refreshTable(connection, database, table), ["stop"]),
|
|
60115
60672
|
title: _ctx.$t("explorer.refreshTable")
|
|
60116
|
-
}, [..._cache[12] || (_cache[12] = [createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)])], 8,
|
|
60673
|
+
}, [..._cache[12] || (_cache[12] = [createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)])], 8, _hoisted_42)])
|
|
60117
60674
|
])], 2);
|
|
60118
60675
|
}), 128))])) : createCommentVNode("", true)], 2);
|
|
60119
60676
|
}), 128))])) : createCommentVNode("", true)], 2);
|
|
60120
|
-
}), 128))]), connections.value.length === 0 ? (openBlock(), createElementBlock("div",
|
|
60677
|
+
}), 128))]), connections.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_43, [_cache[14] || (_cache[14] = createBaseVNode("div", { class: "empty-icon" }, [createBaseVNode("i", { class: "bi bi-inbox" })], -1)), createBaseVNode("div", _hoisted_44, [createBaseVNode("p", null, toDisplayString(_ctx.$t("connection.noConnectionYet")), 1), createBaseVNode("button", {
|
|
60121
60678
|
class: "btn btn-primary btn-sm",
|
|
60122
60679
|
onClick: showAddConnectionModal
|
|
60123
|
-
}, [_cache[
|
|
60680
|
+
}, [_cache[13] || (_cache[13] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("explorer.addConnection")), 1)])])])) : createCommentVNode("", true)])]), createBaseVNode("div", _hoisted_45, [selectedConnection.value && !selectedDatabase.value && !selectedTable.value ? (openBlock(), createBlock(connection_detail_default, {
|
|
60124
60681
|
key: 0,
|
|
60125
60682
|
connection: selectedConnection.value,
|
|
60126
60683
|
onTestConnection: handleTestConnection,
|
|
@@ -60178,8 +60735,8 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
60178
60735
|
"total",
|
|
60179
60736
|
"sql-result",
|
|
60180
60737
|
"sql-executing"
|
|
60181
|
-
])) : (openBlock(), createElementBlock("div",
|
|
60182
|
-
_cache[
|
|
60738
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_46, [createBaseVNode("div", _hoisted_47, [
|
|
60739
|
+
_cache[15] || (_cache[15] = createBaseVNode("div", { class: "default-icon" }, [createBaseVNode("i", { class: "bi bi-diagram-3" })], -1)),
|
|
60183
60740
|
createBaseVNode("h5", null, toDisplayString(_ctx.$t("explorer.defaultTitle")), 1),
|
|
60184
60741
|
createBaseVNode("p", null, toDisplayString(_ctx.$t("explorer.defaultDesc")), 1)
|
|
60185
60742
|
])]))])]),
|
|
@@ -60198,8 +60755,8 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
|
|
|
60198
60755
|
});
|
|
60199
60756
|
}));
|
|
60200
60757
|
//#endregion
|
|
60201
|
-
//#region src/platform/database/explorer.vue?vue&type=style&index=0&scoped=
|
|
60202
|
-
var
|
|
60758
|
+
//#region src/platform/database/explorer.vue?vue&type=style&index=0&scoped=eb8894a1&lang.css
|
|
60759
|
+
var init_explorer_vue_vue_type_style_index_0_scoped_eb8894a1_lang = __esmMin((() => {}));
|
|
60203
60760
|
//#endregion
|
|
60204
60761
|
//#region src/platform/database/explorer.vue
|
|
60205
60762
|
var explorer_default;
|
|
@@ -60207,8 +60764,8 @@ var explorer_default;
|
|
|
60207
60764
|
__esmMin((() => {
|
|
60208
60765
|
init_explorer_vue_vue_type_script_setup_true_lang();
|
|
60209
60766
|
init_explorer_vue_vue_type_script_setup_true_lang();
|
|
60210
|
-
|
|
60767
|
+
init_explorer_vue_vue_type_style_index_0_scoped_eb8894a1_lang();
|
|
60211
60768
|
init__plugin_vue_export_helper();
|
|
60212
|
-
explorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(explorer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-
|
|
60769
|
+
explorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(explorer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-eb8894a1"]]);
|
|
60213
60770
|
}))();
|
|
60214
60771
|
export { explorer_default as default };
|