fdb2 1.0.35 → 1.0.37

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.
Files changed (41) hide show
  1. package/README.md +20 -1
  2. package/dist/public/explorer.css +1338 -1122
  3. package/dist/public/explorer.js +990 -665
  4. package/dist/public/index.css +797 -120
  5. package/dist/public/index.js +282 -26
  6. package/dist/public/layout.css +201 -202
  7. package/dist/public/layout.js +14 -14
  8. package/dist/server/index.d.ts.map +1 -1
  9. package/dist/server/index.js.map +1 -1
  10. package/dist/server/index.ts +0 -1
  11. package/dist/server/service/database/clickhouse-connection.d.ts.map +1 -1
  12. package/dist/server/service/database/clickhouse-connection.js +3 -3
  13. package/dist/server/service/database/clickhouse-connection.js.map +1 -1
  14. package/dist/server/service/database/clickhouse-connection.ts +3 -3
  15. package/dist/server/service/database/mssql.service.d.ts.map +1 -1
  16. package/dist/server/service/database/mssql.service.js +14 -45
  17. package/dist/server/service/database/mssql.service.js.map +1 -1
  18. package/dist/server/service/database/mssql.service.ts +21 -49
  19. package/dist/server/service/database/mysql.service.d.ts.map +1 -1
  20. package/dist/server/service/database/mysql.service.js +34 -52
  21. package/dist/server/service/database/mysql.service.js.map +1 -1
  22. package/dist/server/service/database/mysql.service.ts +50 -55
  23. package/dist/server/service/database/oracle.service.d.ts.map +1 -1
  24. package/dist/server/service/database/oracle.service.js +16 -53
  25. package/dist/server/service/database/oracle.service.js.map +1 -1
  26. package/dist/server/service/database/oracle.service.ts +23 -56
  27. package/dist/server/service/database/postgres.service.d.ts.map +1 -1
  28. package/dist/server/service/database/postgres.service.js +15 -53
  29. package/dist/server/service/database/postgres.service.js.map +1 -1
  30. package/dist/server/service/database/postgres.service.ts +22 -57
  31. package/dist/server/service/database/sql-type.helper.d.ts +28 -0
  32. package/dist/server/service/database/sql-type.helper.d.ts.map +1 -0
  33. package/dist/server/service/database/sql-type.helper.js +151 -0
  34. package/dist/server/service/database/sql-type.helper.js.map +1 -0
  35. package/dist/server/service/database/sql-type.helper.ts +157 -0
  36. package/dist/server/service/database/sqlite.service.d.ts.map +1 -1
  37. package/dist/server/service/database/sqlite.service.js +58 -67
  38. package/dist/server/service/database/sqlite.service.js.map +1 -1
  39. package/dist/server/service/database/sqlite.service.ts +72 -72
  40. package/package.json +6 -2
  41. package/public/fdb2.png +0 -0
@@ -1,6 +1,6 @@
1
1
  import { i as __require, n as __esmMin, t as __commonJSMin } from "./rolldown-runtime.js";
2
2
  import { A as defineComponent, B as renderList, C as createBlock, D as createStaticVNode, E as createSlots, F as nextTick, G as withCtx, I as onBeforeUnmount, K as withDirectives, L as onMounted, O as createTextVNode, S as createBaseVNode, T as createElementBlock, W as watch, _ as vModelText, a as init_vue_router, b as Fragment, ct as toDisplayString, d as init_vue_runtime_esm_bundler, g as vModelSelect, h as vModelCheckbox, k as createVNode, l as init_vue_i18n, o as useRoute, ot as normalizeClass, s as useRouter, st as normalizeStyle, tt as ref, u as useI18n, v as vShow, w as createCommentVNode, x as computed, y as withModifiers, z as openBlock } from "./vue.js";
3
- import { _ as init_i18n, a as dataGrid_default, b as defineStore, c as modal_default, d as toast, f as init_toast$1, g as getT, h as init__plugin_vue_export_helper, i as showConfirm, l as init_loading, m as _plugin_vue_export_helper_default, n as init_modal$2, o as init_dataGrid, p as toast_default, r as showAlert, s as init_modal$1, t as getModalInstance, u as init_toast, v as init_base, x as init_pinia, y as request } from "./index.js";
3
+ import { A as defineStore, C as init_rpc, D as vscodeSaveFile, E as vscodePickSaveFolder, O as init_detect, S as blobToBase64, T as vscodeNotifyExported, _ as init__plugin_vue_export_helper, a as dataGrid_default, b as init_base, c as pagination_default, d as init_loading, f as init_toast, g as _plugin_vue_export_helper_default, h as toast_default, i as showConfirm, j as init_pinia, k as isVSCode, l as init_modal$1, m as init_toast$1, n as init_modal$2, o as init_dataGrid, p as toast, r as showAlert, s as init_pagination, t as getModalInstance, u as modal_default, v as getT, w as isVscodeWebview, x as request, y as init_i18n } from "./index.js";
4
4
  //#region src/service/database.ts
5
5
  var ConnectionService, DatabaseService;
6
6
  var init_database = __esmMin((() => {
@@ -414,7 +414,7 @@ var init_database = __esmMin((() => {
414
414
  }));
415
415
  //#endregion
416
416
  //#region src/components/connection-editor/index.vue?vue&type=script&setup=true&lang.ts
417
- 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$9, _hoisted_19$9, _hoisted_20$8, _hoisted_21$8, _hoisted_22$8, _hoisted_23$8, _hoisted_24$8, _hoisted_25$7, _hoisted_26$7, _hoisted_27$7, _hoisted_28$7, _hoisted_29$7, _hoisted_30$6, _hoisted_31$6, _hoisted_32$6, _hoisted_33$6, _hoisted_34$6, _hoisted_35$6, _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$4, _hoisted_54$4, _hoisted_55$4, _hoisted_56$4, _hoisted_57$4, _hoisted_58$4, _hoisted_59$4, _hoisted_60$4, _hoisted_61$4, index_vue_vue_type_script_setup_true_lang_default;
417
+ 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$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$6, _hoisted_31$6, _hoisted_32$6, _hoisted_33$6, _hoisted_34$6, _hoisted_35$6, _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$4, _hoisted_55$4, _hoisted_56$4, _hoisted_57$4, _hoisted_58$4, _hoisted_59$4, _hoisted_60$4, _hoisted_61$4, index_vue_vue_type_script_setup_true_lang_default;
418
418
  var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
419
419
  init_vue_runtime_esm_bundler();
420
420
  init_vue_i18n();
@@ -448,7 +448,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
448
448
  _hoisted_22$8 = { class: "form-label-modern" };
449
449
  _hoisted_23$8 = ["placeholder"];
450
450
  _hoisted_24$8 = { class: "form-group-modern" };
451
- _hoisted_25$7 = { class: "form-label-modern" };
451
+ _hoisted_25$8 = { class: "form-label-modern" };
452
452
  _hoisted_26$7 = ["placeholder"];
453
453
  _hoisted_27$7 = { class: "form-group-modern" };
454
454
  _hoisted_28$7 = { class: "form-label-modern" };
@@ -479,7 +479,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
479
479
  _hoisted_50$5 = { class: "section-header" };
480
480
  _hoisted_51$5 = { class: "section-title" };
481
481
  _hoisted_52$5 = { class: "section-content" };
482
- _hoisted_53$4 = { class: "form-group-modern" };
482
+ _hoisted_53$5 = { class: "form-group-modern" };
483
483
  _hoisted_54$4 = { class: "form-label-modern" };
484
484
  _hoisted_55$4 = { class: "form-check-modern" };
485
485
  _hoisted_56$4 = {
@@ -779,7 +779,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
779
779
  void 0,
780
780
  { number: true }
781
781
  ]])]),
782
- createBaseVNode("div", _hoisted_24$8, [createBaseVNode("label", _hoisted_25$7, [
782
+ createBaseVNode("div", _hoisted_24$8, [createBaseVNode("label", _hoisted_25$8, [
783
783
  _cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-database me-2" }, null, -1)),
784
784
  createTextVNode(toDisplayString(_ctx.$t("connection.databaseName")) + " ", 1),
785
785
  _cache[22] || (_cache[22] = createBaseVNode("span", { class: "required" }, "*", -1))
@@ -825,7 +825,7 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
825
825
  "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => connectionForm.value.password = $event),
826
826
  placeholder: _ctx.$t("connection.passwordPlaceholder")
827
827
  }, null, 8, _hoisted_48$5), [[vModelText, connectionForm.value.password]])])])])]),
828
- createBaseVNode("div", _hoisted_49$5, [createBaseVNode("div", _hoisted_50$5, [_cache[30] || (_cache[30] = createBaseVNode("div", { class: "section-icon" }, [createBaseVNode("i", { class: "bi bi-gear" })], -1)), createBaseVNode("h3", _hoisted_51$5, toDisplayString(_ctx.$t("connection.otherOptions")), 1)]), createBaseVNode("div", _hoisted_52$5, [createBaseVNode("div", _hoisted_53$4, [createBaseVNode("label", _hoisted_54$4, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-toggle-on me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("connection.connectionStatus")), 1)]), createBaseVNode("div", _hoisted_55$4, [withDirectives(createBaseVNode("input", {
828
+ createBaseVNode("div", _hoisted_49$5, [createBaseVNode("div", _hoisted_50$5, [_cache[30] || (_cache[30] = createBaseVNode("div", { class: "section-icon" }, [createBaseVNode("i", { class: "bi bi-gear" })], -1)), createBaseVNode("h3", _hoisted_51$5, toDisplayString(_ctx.$t("connection.otherOptions")), 1)]), createBaseVNode("div", _hoisted_52$5, [createBaseVNode("div", _hoisted_53$5, [createBaseVNode("label", _hoisted_54$4, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-toggle-on me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("connection.connectionStatus")), 1)]), createBaseVNode("div", _hoisted_55$4, [withDirectives(createBaseVNode("input", {
829
829
  class: "form-check-input-modern",
830
830
  type: "checkbox",
831
831
  "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => connectionForm.value.enabled = $event),
@@ -859,17 +859,17 @@ var init_index_vue_vue_type_script_setup_true_lang = __esmMin((() => {
859
859
  });
860
860
  }));
861
861
  //#endregion
862
- //#region src/components/connection-editor/index.vue?vue&type=style&index=0&scoped=3a550e2d&lang.css
863
- var init_index_vue_vue_type_style_index_0_scoped_3a550e2d_lang = __esmMin((() => {}));
862
+ //#region src/components/connection-editor/index.vue?vue&type=style&index=0&scoped=7681a313&lang.css
863
+ var init_index_vue_vue_type_style_index_0_scoped_7681a313_lang = __esmMin((() => {}));
864
864
  //#endregion
865
865
  //#region src/components/connection-editor/index.vue
866
866
  var connection_editor_default;
867
867
  var init_connection_editor = __esmMin((() => {
868
868
  init_index_vue_vue_type_script_setup_true_lang();
869
869
  init_index_vue_vue_type_script_setup_true_lang();
870
- init_index_vue_vue_type_style_index_0_scoped_3a550e2d_lang();
870
+ init_index_vue_vue_type_style_index_0_scoped_7681a313_lang();
871
871
  init__plugin_vue_export_helper();
872
- connection_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-3a550e2d"]]);
872
+ connection_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(index_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7681a313"]]);
873
873
  })), ModalHelper, modal;
874
874
  var init_modal = __esmMin((() => {
875
875
  init_vue_runtime_esm_bundler();
@@ -53039,7 +53039,20 @@ function exportDataToJSON(data, filename = "export.json") {
53039
53039
  const jsonContent = JSON.stringify(data, null, 2);
53040
53040
  downloadFile(new Blob([jsonContent], { type: "application/json;charset=utf-8;" }), filename);
53041
53041
  }
53042
- function downloadFile(blob, filename) {
53042
+ async function downloadFile(blob, filename) {
53043
+ if (isVscodeWebview()) {
53044
+ const ext = (filename.split(".").pop() || "").toLowerCase();
53045
+ try {
53046
+ await vscodeSaveFile({
53047
+ filename,
53048
+ base64: await blobToBase64(blob),
53049
+ filters: ext ? { [`${ext.toUpperCase()} 文件`]: [ext] } : void 0
53050
+ });
53051
+ } catch (e) {
53052
+ console.error("[vscode] 保存文件失败:", e);
53053
+ }
53054
+ return;
53055
+ }
53043
53056
  const url = URL.createObjectURL(blob);
53044
53057
  const link = document.createElement("a");
53045
53058
  link.href = url;
@@ -53055,8 +53068,55 @@ function formatFileName(baseName, extension) {
53055
53068
  }
53056
53069
  var init_export = __esmMin((() => {
53057
53070
  init_xlsx();
53071
+ init_rpc();
53058
53072
  }));
53059
53073
  //#endregion
53074
+ //#region src/platform/database/utils/theme.ts
53075
+ function isDarkTheme() {
53076
+ if (typeof document === "undefined") return false;
53077
+ const cls = document.body?.classList;
53078
+ if (cls && (cls.contains("vscode-light") || cls.contains("vscode-dark") || cls.contains("vscode-high-contrast"))) return cls.contains("vscode-dark") || cls.contains("vscode-high-contrast");
53079
+ if (cls?.contains("platform-desktop")) return true;
53080
+ return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-color-scheme: dark)").matches;
53081
+ }
53082
+ /** 监听主题变化(webview 切主题 / OS 切深色),返回取消函数 */
53083
+ function onThemeChange(cb) {
53084
+ if (typeof window === "undefined") return () => void 0;
53085
+ let disposed = false;
53086
+ const off = [];
53087
+ if (typeof MutationObserver !== "undefined" && document.body) {
53088
+ let last = isDarkTheme();
53089
+ const observer = new MutationObserver(() => {
53090
+ const now = isDarkTheme();
53091
+ if (now !== last) {
53092
+ last = now;
53093
+ cb();
53094
+ }
53095
+ });
53096
+ observer.observe(document.body, {
53097
+ attributes: true,
53098
+ attributeFilter: ["class"]
53099
+ });
53100
+ off.push(() => observer.disconnect());
53101
+ }
53102
+ const mq = window.matchMedia?.("(prefers-color-scheme: dark)");
53103
+ if (mq?.addEventListener) {
53104
+ const handler = () => !disposed && cb();
53105
+ mq.addEventListener("change", handler);
53106
+ off.push(() => mq.removeEventListener("change", handler));
53107
+ }
53108
+ const onMsg = (event) => {
53109
+ if (!disposed && event.data?.command === "themeChanged") cb();
53110
+ };
53111
+ window.addEventListener("message", onMsg);
53112
+ off.push(() => window.removeEventListener("message", onMsg));
53113
+ return () => {
53114
+ disposed = true;
53115
+ off.forEach((fn) => fn());
53116
+ };
53117
+ }
53118
+ var init_theme = __esmMin((() => {}));
53119
+ //#endregion
53060
53120
  //#region src/platform/database/components/sql-executor.vue?vue&type=script&setup=true&lang.ts
53061
53121
  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$8, _hoisted_19$8, sql_executor_vue_vue_type_script_setup_true_lang_default;
53062
53122
  var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
@@ -53072,6 +53132,7 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53072
53132
  init_database();
53073
53133
  init_modal();
53074
53134
  init_export();
53135
+ init_theme();
53075
53136
  _hoisted_1$8 = { class: "sql-executor" };
53076
53137
  _hoisted_2$8 = { class: "sql-toolbar" };
53077
53138
  _hoisted_3$8 = { class: "toolbar-left" };
@@ -53252,7 +53313,7 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53252
53313
  drawSelection(),
53253
53314
  placeholder(t("sqlExecutor.inputSQLPlaceholder")),
53254
53315
  sql(),
53255
- oneDark,
53316
+ ...isDarkTheme() ? [oneDark] : [],
53256
53317
  keymap.of(defaultKeymap),
53257
53318
  EditorView.updateListener.of((update) => {
53258
53319
  if (update.docChanged) sqlQuery.value = update.state.doc.toString();
@@ -53269,12 +53330,12 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53269
53330
  minHeight: "100%"
53270
53331
  },
53271
53332
  ".cm-gutters": {
53272
- backgroundColor: "#282c34",
53273
- color: "#abb2bf",
53333
+ backgroundColor: "var(--db-code-bg)",
53334
+ color: "var(--db-code-fg)",
53274
53335
  border: "none"
53275
53336
  },
53276
- ".cm-activeLineGutter": { backgroundColor: "#282c34" },
53277
- ".cm-activeLine": { backgroundColor: "rgba(255, 255, 255, 0.1)" }
53337
+ ".cm-activeLineGutter": { backgroundColor: "var(--db-code-bg)" },
53338
+ ".cm-activeLine": { backgroundColor: isDarkTheme() ? "rgba(255, 255, 255, 0.1)" : "rgba(0, 0, 0, 0.06)" }
53278
53339
  })
53279
53340
  ]
53280
53341
  });
@@ -53303,26 +53364,26 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53303
53364
  height: "100%",
53304
53365
  fontSize: "14px",
53305
53366
  fontFamily: "Monaco, Menlo, Consolas, \"Courier New\", monospace",
53306
- backgroundColor: "#f8f9fa",
53307
- color: "#212529"
53367
+ backgroundColor: "var(--db-bg-soft2)",
53368
+ color: "var(--db-text-body)"
53308
53369
  },
53309
53370
  ".cm-content": {
53310
53371
  padding: "10px",
53311
53372
  minHeight: "100%",
53312
- backgroundColor: "#ffffff",
53313
- color: "#212529",
53314
- border: "1px solid #dee2e6"
53373
+ backgroundColor: "var(--db-surface)",
53374
+ color: "var(--db-text-body)",
53375
+ border: "1px solid var(--db-border-lighter)"
53315
53376
  },
53316
53377
  ".cm-gutters": {
53317
- backgroundColor: "#f8f9fa",
53318
- color: "#6c757d",
53319
- border: "1px solid #dee2e6",
53378
+ backgroundColor: "var(--db-bg-soft2)",
53379
+ color: "var(--db-text-muted)",
53380
+ border: "1px solid var(--db-border-lighter)",
53320
53381
  borderRight: "none"
53321
53382
  },
53322
- ".cm-activeLineGutter": { backgroundColor: "#e9ecef" },
53323
- ".cm-activeLine": { backgroundColor: "#e9ecef" },
53324
- ".cm-selectionBackground": { backgroundColor: "#cce7ff" },
53325
- ".cm-line": { color: "#212529" }
53383
+ ".cm-activeLineGutter": { backgroundColor: "var(--db-border-soft)" },
53384
+ ".cm-activeLine": { backgroundColor: "var(--db-border-soft)" },
53385
+ ".cm-selectionBackground": { backgroundColor: "var(--db-info-bg)" },
53386
+ ".cm-line": { color: "var(--db-text-body)" }
53326
53387
  })
53327
53388
  ]
53328
53389
  });
@@ -53371,9 +53432,23 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53371
53432
  } });
53372
53433
  }
53373
53434
  }
53435
+ let offTheme = null;
53374
53436
  onMounted(() => {
53375
53437
  initEditor();
53376
53438
  initResultEditor();
53439
+ offTheme = onThemeChange(() => {
53440
+ editor.value?.destroy();
53441
+ editor.value = null;
53442
+ resultEditor.value?.destroy();
53443
+ resultEditor.value = null;
53444
+ initEditor();
53445
+ initResultEditor();
53446
+ });
53447
+ });
53448
+ onBeforeUnmount(() => {
53449
+ offTheme?.();
53450
+ editor.value?.destroy();
53451
+ resultEditor.value?.destroy();
53377
53452
  });
53378
53453
  watch(sqlResult, () => {
53379
53454
  if (sqlResult.value && resultEditor.value) updateResultEditor();
@@ -53424,21 +53499,21 @@ var init_sql_executor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53424
53499
  });
53425
53500
  }));
53426
53501
  //#endregion
53427
- //#region src/platform/database/components/sql-executor.vue?vue&type=style&index=0&scoped=fe79b105&lang.css
53428
- var init_sql_executor_vue_vue_type_style_index_0_scoped_fe79b105_lang = __esmMin((() => {}));
53502
+ //#region src/platform/database/components/sql-executor.vue?vue&type=style&index=0&scoped=4b956460&lang.css
53503
+ var init_sql_executor_vue_vue_type_style_index_0_scoped_4b956460_lang = __esmMin((() => {}));
53429
53504
  //#endregion
53430
53505
  //#region src/platform/database/components/sql-executor.vue
53431
53506
  var sql_executor_default;
53432
53507
  var init_sql_executor = __esmMin((() => {
53433
53508
  init_sql_executor_vue_vue_type_script_setup_true_lang();
53434
53509
  init_sql_executor_vue_vue_type_script_setup_true_lang();
53435
- init_sql_executor_vue_vue_type_style_index_0_scoped_fe79b105_lang();
53510
+ init_sql_executor_vue_vue_type_style_index_0_scoped_4b956460_lang();
53436
53511
  init__plugin_vue_export_helper();
53437
- sql_executor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(sql_executor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-fe79b105"]]);
53512
+ sql_executor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(sql_executor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-4b956460"]]);
53438
53513
  }));
53439
53514
  //#endregion
53440
53515
  //#region src/platform/database/components/connection-detail.vue?vue&type=script&setup=true&lang.ts
53441
- 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$7, _hoisted_19$7, _hoisted_20$7, _hoisted_21$7, _hoisted_22$7, _hoisted_23$7, _hoisted_24$7, _hoisted_25$6, _hoisted_26$6, _hoisted_27$6, _hoisted_28$6, _hoisted_29$6, _hoisted_30$5, _hoisted_31$5, _hoisted_32$5, _hoisted_33$5, _hoisted_34$5, _hoisted_35$5, _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$3, _hoisted_54$3, _hoisted_55$3, _hoisted_56$3, _hoisted_57$3, _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$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$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, connection_detail_vue_vue_type_script_setup_true_lang_default;
53516
+ 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$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$5, _hoisted_31$5, _hoisted_32$5, _hoisted_33$5, _hoisted_34$5, _hoisted_35$5, _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$3, _hoisted_55$3, _hoisted_56$3, _hoisted_57$3, _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$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$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, connection_detail_vue_vue_type_script_setup_true_lang_default;
53442
53517
  var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
53443
53518
  init_vue_runtime_esm_bundler();
53444
53519
  init_vue_router();
@@ -53473,7 +53548,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53473
53548
  _hoisted_22$7 = { class: "info-label" };
53474
53549
  _hoisted_23$7 = { class: "info-value" };
53475
53550
  _hoisted_24$7 = { class: "info-item" };
53476
- _hoisted_25$6 = { class: "info-label" };
53551
+ _hoisted_25$7 = { class: "info-label" };
53477
53552
  _hoisted_26$6 = { class: "info-value" };
53478
53553
  _hoisted_27$6 = { class: "info-item" };
53479
53554
  _hoisted_28$6 = { class: "info-label" };
@@ -53501,7 +53576,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53501
53576
  _hoisted_50$4 = { class: "action-text" };
53502
53577
  _hoisted_51$4 = { class: "action-text" };
53503
53578
  _hoisted_52$4 = { class: "connection-tabs" };
53504
- _hoisted_53$3 = { class: "nav nav-tabs" };
53579
+ _hoisted_53$4 = { class: "nav nav-tabs" };
53505
53580
  _hoisted_54$3 = { class: "nav-item" };
53506
53581
  _hoisted_55$3 = { class: "badge bg-primary ms-1" };
53507
53582
  _hoisted_56$3 = { class: "nav-item" };
@@ -53509,13 +53584,16 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53509
53584
  _hoisted_58$3 = { class: "tab-panel" };
53510
53585
  _hoisted_59$3 = { class: "databases-section" };
53511
53586
  _hoisted_60$3 = { class: "section-header" };
53512
- _hoisted_61$3 = { class: "section-actions" };
53513
- _hoisted_62$3 = { class: "search-box" };
53514
- _hoisted_63$3 = ["placeholder"];
53515
- _hoisted_64$3 = ["disabled"];
53516
- _hoisted_65$3 = {
53587
+ _hoisted_61$3 = { class: "db-search" };
53588
+ _hoisted_62$3 = ["placeholder"];
53589
+ _hoisted_63$3 = ["disabled", "title"];
53590
+ _hoisted_64$3 = {
53517
53591
  key: 0,
53518
- class: "spinner-border spinner-border-sm me-1"
53592
+ class: "spinner-border spinner-border-sm"
53593
+ };
53594
+ _hoisted_65$3 = {
53595
+ key: 1,
53596
+ class: "bi bi-arrow-clockwise"
53519
53597
  };
53520
53598
  _hoisted_66$3 = { class: "databases-list" };
53521
53599
  _hoisted_67$3 = {
@@ -53794,7 +53872,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53794
53872
  isDetailsExpanded.value ? (openBlock(), createElementBlock("div", _hoisted_11$7, [createBaseVNode("div", _hoisted_12$7, [createBaseVNode("div", _hoisted_13$7, [createBaseVNode("div", _hoisted_14$7, [createBaseVNode("div", _hoisted_15$7, [createBaseVNode("h6", _hoisted_16$7, [_cache[17] || (_cache[17] = createBaseVNode("i", { class: "bi bi-info-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("connection.basicInfo")), 1)]), createBaseVNode("div", _hoisted_17$7, [
53795
53873
  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)]),
53796
53874
  createBaseVNode("div", _hoisted_21$7, [createBaseVNode("label", _hoisted_22$7, toDisplayString(_ctx.$t("connection.port")), 1), createBaseVNode("div", _hoisted_23$7, toDisplayString(__props.connection?.port), 1)]),
53797
- createBaseVNode("div", _hoisted_24$7, [createBaseVNode("label", _hoisted_25$6, toDisplayString(_ctx.$t("connection.username")), 1), createBaseVNode("div", _hoisted_26$6, toDisplayString(__props.connection?.username), 1)]),
53875
+ createBaseVNode("div", _hoisted_24$7, [createBaseVNode("label", _hoisted_25$7, toDisplayString(_ctx.$t("connection.username")), 1), createBaseVNode("div", _hoisted_26$6, toDisplayString(__props.connection?.username), 1)]),
53798
53876
  createBaseVNode("div", _hoisted_27$6, [createBaseVNode("label", _hoisted_28$6, toDisplayString(_ctx.$t("connection.databaseType")), 1), createBaseVNode("div", _hoisted_29$6, [createBaseVNode("span", { class: normalizeClass(["db-type-badge", getDbLogoClass(__props.connection?.type)]) }, toDisplayString(getDbTypeLabel(__props.connection?.type)), 3)])])
53799
53877
  ])]), createBaseVNode("div", _hoisted_30$5, [createBaseVNode("h6", _hoisted_31$5, [_cache[18] || (_cache[18] = createBaseVNode("i", { class: "bi bi-bar-chart" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("connection.connectionStats")), 1)]), createBaseVNode("div", _hoisted_32$5, [
53800
53878
  createBaseVNode("div", _hoisted_33$5, [createBaseVNode("div", _hoisted_34$5, toDisplayString(connectionStats.value.databaseCount || 0), 1), createBaseVNode("div", _hoisted_35$5, toDisplayString(_ctx.$t("connection.databaseCount")), 1)]),
@@ -53816,7 +53894,7 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53816
53894
  onClick: viewLogs
53817
53895
  }, [_cache[22] || (_cache[22] = createBaseVNode("div", { class: "action-icon" }, [createBaseVNode("i", { class: "bi bi-file-text" })], -1)), createBaseVNode("div", _hoisted_51$4, toDisplayString(_ctx.$t("connection.viewLogs")), 1)])
53818
53896
  ])]),
53819
- createBaseVNode("div", _hoisted_52$4, [createBaseVNode("ul", _hoisted_53$3, [createBaseVNode("li", _hoisted_54$3, [createBaseVNode("button", {
53897
+ createBaseVNode("div", _hoisted_52$4, [createBaseVNode("ul", _hoisted_53$4, [createBaseVNode("li", _hoisted_54$3, [createBaseVNode("button", {
53820
53898
  class: normalizeClass(["nav-link", { active: activeTab.value === "databases" }]),
53821
53899
  onClick: _cache[0] || (_cache[0] = ($event) => activeTab.value = "databases")
53822
53900
  }, [
@@ -53826,21 +53904,17 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53826
53904
  ], 2)]), createBaseVNode("li", _hoisted_56$3, [createBaseVNode("button", {
53827
53905
  class: normalizeClass(["nav-link", { active: activeTab.value === "sql" }]),
53828
53906
  onClick: _cache[1] || (_cache[1] = ($event) => activeTab.value = "sql")
53829
- }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("nav.sqlQuery")), 1)], 2)])]), createBaseVNode("div", _hoisted_57$3, [withDirectives(createBaseVNode("div", _hoisted_58$3, [createBaseVNode("div", _hoisted_59$3, [createBaseVNode("div", _hoisted_60$3, [createBaseVNode("div", _hoisted_61$3, [createBaseVNode("div", _hoisted_62$3, [withDirectives(createBaseVNode("input", {
53907
+ }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("nav.sqlQuery")), 1)], 2)])]), createBaseVNode("div", _hoisted_57$3, [withDirectives(createBaseVNode("div", _hoisted_58$3, [createBaseVNode("div", _hoisted_59$3, [createBaseVNode("div", _hoisted_60$3, [createBaseVNode("div", _hoisted_61$3, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-search" }, null, -1)), withDirectives(createBaseVNode("input", {
53830
53908
  type: "text",
53831
- class: "form-control form-control-sm",
53909
+ class: "db-search-input",
53832
53910
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchKeyword.value = $event),
53833
- placeholder: _ctx.$t("connection.searchDatabase"),
53834
- style: { "width": "200px" }
53835
- }, null, 8, _hoisted_63$3), [[vModelText, searchKeyword.value]])]), createBaseVNode("button", {
53836
- class: "btn btn-sm btn-outline-primary ms-2",
53911
+ placeholder: _ctx.$t("connection.searchDatabase")
53912
+ }, null, 8, _hoisted_62$3), [[vModelText, searchKeyword.value]])]), createBaseVNode("button", {
53913
+ class: "db-refresh-btn",
53837
53914
  onClick: loadDatabases,
53838
- disabled: loadingDatabases.value
53839
- }, [
53840
- loadingDatabases.value ? (openBlock(), createElementBlock("span", _hoisted_65$3)) : createCommentVNode("", true),
53841
- _cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)),
53842
- createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)
53843
- ], 8, _hoisted_64$3)])]), createBaseVNode("div", _hoisted_66$3, [loadingDatabases.value ? (openBlock(), createElementBlock("div", _hoisted_67$3, [_cache[26] || (_cache[26] = 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_68$3, [
53915
+ disabled: loadingDatabases.value,
53916
+ title: _ctx.$t("common.refresh")
53917
+ }, [loadingDatabases.value ? (openBlock(), createElementBlock("span", _hoisted_64$3)) : (openBlock(), createElementBlock("i", _hoisted_65$3))], 8, _hoisted_63$3)]), createBaseVNode("div", _hoisted_66$3, [loadingDatabases.value ? (openBlock(), createElementBlock("div", _hoisted_67$3, [_cache[26] || (_cache[26] = 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_68$3, [
53844
53918
  _cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-database" }, null, -1)),
53845
53919
  createBaseVNode("p", null, toDisplayString(searchKeyword.value ? _ctx.$t("connection.noMatchDatabase") : _ctx.$t("connection.noDatabase")), 1),
53846
53920
  createBaseVNode("button", {
@@ -53947,17 +54021,17 @@ var init_connection_detail_vue_vue_type_script_setup_true_lang = __esmMin((() =>
53947
54021
  });
53948
54022
  }));
53949
54023
  //#endregion
53950
- //#region src/platform/database/components/connection-detail.vue?vue&type=style&index=0&scoped=15dc1761&lang.css
53951
- var init_connection_detail_vue_vue_type_style_index_0_scoped_15dc1761_lang = __esmMin((() => {}));
54024
+ //#region src/platform/database/components/connection-detail.vue?vue&type=style&index=0&scoped=ef9effac&lang.css
54025
+ var init_connection_detail_vue_vue_type_style_index_0_scoped_ef9effac_lang = __esmMin((() => {}));
53952
54026
  //#endregion
53953
54027
  //#region src/platform/database/components/connection-detail.vue
53954
54028
  var connection_detail_default;
53955
54029
  var init_connection_detail = __esmMin((() => {
53956
54030
  init_connection_detail_vue_vue_type_script_setup_true_lang();
53957
54031
  init_connection_detail_vue_vue_type_script_setup_true_lang();
53958
- init_connection_detail_vue_vue_type_style_index_0_scoped_15dc1761_lang();
54032
+ init_connection_detail_vue_vue_type_style_index_0_scoped_ef9effac_lang();
53959
54033
  init__plugin_vue_export_helper();
53960
- connection_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(connection_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-15dc1761"]]);
54034
+ connection_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(connection_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-ef9effac"]]);
53961
54035
  }));
53962
54036
  //#endregion
53963
54037
  //#region src/typings/database-types.ts
@@ -54957,7 +55031,7 @@ var init_database_types$1 = __esmMin((() => {
54957
55031
  label: "VARCHAR",
54958
55032
  category: "string",
54959
55033
  requiresLength: true,
54960
- defaultLength: 1,
55034
+ defaultLength: 255,
54961
55035
  description: "可变长度字符串"
54962
55036
  },
54963
55037
  {
@@ -54979,7 +55053,7 @@ var init_database_types$1 = __esmMin((() => {
54979
55053
  label: "NVARCHAR",
54980
55054
  category: "string",
54981
55055
  requiresLength: true,
54982
- defaultLength: 1,
55056
+ defaultLength: 255,
54983
55057
  description: "Unicode可变长度字符串"
54984
55058
  },
54985
55059
  {
@@ -55001,7 +55075,7 @@ var init_database_types$1 = __esmMin((() => {
55001
55075
  label: "VARBINARY",
55002
55076
  category: "binary",
55003
55077
  requiresLength: true,
55004
- defaultLength: 1,
55078
+ defaultLength: 255,
55005
55079
  description: "可变长度二进制"
55006
55080
  },
55007
55081
  {
@@ -55191,7 +55265,7 @@ var init_database_types = __esmMin((() => {
55191
55265
  }));
55192
55266
  //#endregion
55193
55267
  //#region src/platform/database/components/table-editor.vue?vue&type=script&setup=true&lang.ts
55194
- 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, _hoisted_18$6, _hoisted_19$6, _hoisted_20$6, _hoisted_21$6, _hoisted_22$6, _hoisted_23$6, _hoisted_24$6, _hoisted_25$5, _hoisted_26$5, _hoisted_27$5, _hoisted_28$5, _hoisted_29$5, _hoisted_30$4, _hoisted_31$4, _hoisted_32$4, _hoisted_33$4, _hoisted_34$4, _hoisted_35$4, _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, table_editor_vue_vue_type_script_setup_true_lang_default;
55268
+ 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, _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$4, _hoisted_31$4, _hoisted_32$4, _hoisted_33$4, _hoisted_34$4, _hoisted_35$4, _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, CUSTOM_TYPE_VALUE, table_editor_vue_vue_type_script_setup_true_lang_default;
55195
55269
  var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55196
55270
  init_vue_runtime_esm_bundler();
55197
55271
  init_vue_i18n();
@@ -55199,31 +55273,38 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55199
55273
  init_modal();
55200
55274
  init_database_types$1();
55201
55275
  init_database_types();
55202
- _hoisted_1$6 = { class: "modal-content" };
55203
- _hoisted_2$6 = { class: "modal-header" };
55204
- _hoisted_3$6 = { class: "modal-title" };
55205
- _hoisted_4$6 = { class: "modal-body" };
55206
- _hoisted_5$6 = { class: "table-info-section mb-4" };
55207
- _hoisted_6$6 = { class: "section-title" };
55208
- _hoisted_7$6 = { class: "row" };
55209
- _hoisted_8$6 = { class: "col-md-6" };
55210
- _hoisted_9$6 = { class: "mb-3" };
55211
- _hoisted_10$6 = { class: "form-label" };
55212
- _hoisted_11$6 = ["disabled", "placeholder"];
55213
- _hoisted_12$6 = { class: "col-md-6" };
55214
- _hoisted_13$6 = { class: "mb-3" };
55215
- _hoisted_14$6 = { class: "form-label" };
55216
- _hoisted_15$6 = ["placeholder"];
55217
- _hoisted_16$6 = { class: "columns-section" };
55218
- _hoisted_17$6 = { class: "section-header d-flex justify-content-between align-items-center mb-3" };
55219
- _hoisted_18$6 = { class: "section-title mb-0" };
55220
- _hoisted_19$6 = { class: "table-responsive" };
55221
- _hoisted_20$6 = { class: "table table-sm table-bordered" };
55222
- _hoisted_21$6 = { class: "table-light" };
55276
+ _hoisted_1$6 = {
55277
+ key: 0,
55278
+ class: "modal fade show",
55279
+ style: {
55280
+ "display": "block",
55281
+ "background-color": "rgba(0,0,0,0.5)"
55282
+ }
55283
+ };
55284
+ _hoisted_2$6 = { class: "modal-content" };
55285
+ _hoisted_3$6 = { class: "modal-header" };
55286
+ _hoisted_4$6 = { class: "modal-title" };
55287
+ _hoisted_5$6 = { class: "modal-body" };
55288
+ _hoisted_6$6 = { class: "table-info-section mb-4" };
55289
+ _hoisted_7$6 = { class: "section-title" };
55290
+ _hoisted_8$6 = { class: "row" };
55291
+ _hoisted_9$6 = { class: "col-md-6" };
55292
+ _hoisted_10$6 = { class: "mb-3" };
55293
+ _hoisted_11$6 = { class: "form-label" };
55294
+ _hoisted_12$6 = ["disabled", "placeholder"];
55295
+ _hoisted_13$6 = { class: "col-md-6" };
55296
+ _hoisted_14$6 = { class: "mb-3" };
55297
+ _hoisted_15$6 = { class: "form-label" };
55298
+ _hoisted_16$6 = ["placeholder"];
55299
+ _hoisted_17$6 = { class: "columns-section" };
55300
+ _hoisted_18$6 = { class: "section-header d-flex justify-content-between align-items-center mb-3" };
55301
+ _hoisted_19$6 = { class: "section-title mb-0" };
55302
+ _hoisted_20$6 = { class: "table-responsive" };
55303
+ _hoisted_21$6 = { class: "table table-sm table-bordered" };
55223
55304
  _hoisted_22$6 = { width: "120" };
55224
55305
  _hoisted_23$6 = { width: "140" };
55225
55306
  _hoisted_24$6 = { width: "120" };
55226
- _hoisted_25$5 = { width: "80" };
55307
+ _hoisted_25$6 = { width: "80" };
55227
55308
  _hoisted_26$5 = { width: "100" };
55228
55309
  _hoisted_27$5 = { width: "80" };
55229
55310
  _hoisted_28$5 = { width: "80" };
@@ -55233,30 +55314,32 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55233
55314
  _hoisted_32$4 = { value: "" };
55234
55315
  _hoisted_33$4 = ["label"];
55235
55316
  _hoisted_34$4 = ["value"];
55236
- _hoisted_35$4 = {
55317
+ _hoisted_35$4 = ["onUpdate:modelValue", "placeholder"];
55318
+ _hoisted_36$4 = {
55237
55319
  key: 0,
55238
55320
  class: "input-group input-group-sm"
55239
55321
  };
55240
- _hoisted_36$4 = ["onUpdate:modelValue", "placeholder"];
55241
55322
  _hoisted_37$4 = ["onUpdate:modelValue", "placeholder"];
55242
55323
  _hoisted_38$4 = ["onUpdate:modelValue", "placeholder"];
55243
- _hoisted_39$4 = {
55324
+ _hoisted_39$4 = ["onUpdate:modelValue", "placeholder"];
55325
+ _hoisted_40$4 = {
55244
55326
  key: 1,
55245
55327
  class: "text-muted"
55246
55328
  };
55247
- _hoisted_40$4 = { class: "form-check" };
55248
- _hoisted_41$4 = ["onUpdate:modelValue"];
55249
- _hoisted_42$4 = ["onUpdate:modelValue", "placeholder"];
55250
- _hoisted_43$4 = { class: "form-check" };
55251
- _hoisted_44$4 = ["onUpdate:modelValue", "onChange"];
55252
- _hoisted_45$4 = { class: "form-check" };
55253
- _hoisted_46$4 = ["onUpdate:modelValue", "disabled"];
55254
- _hoisted_47$4 = ["onUpdate:modelValue", "placeholder"];
55255
- _hoisted_48$3 = ["onClick", "disabled"];
55256
- _hoisted_49$3 = { class: "sql-preview-section mt-4" };
55257
- _hoisted_50$3 = { class: "section-title" };
55258
- _hoisted_51$3 = { class: "sql-preview bg-light p-3 rounded" };
55259
- _hoisted_52$3 = { class: "modal-footer" };
55329
+ _hoisted_41$4 = { class: "form-check" };
55330
+ _hoisted_42$4 = ["onUpdate:modelValue"];
55331
+ _hoisted_43$4 = ["onUpdate:modelValue", "placeholder"];
55332
+ _hoisted_44$4 = { class: "form-check" };
55333
+ _hoisted_45$4 = ["onUpdate:modelValue", "onChange"];
55334
+ _hoisted_46$4 = { class: "form-check" };
55335
+ _hoisted_47$4 = ["onUpdate:modelValue", "disabled"];
55336
+ _hoisted_48$3 = ["onUpdate:modelValue", "placeholder"];
55337
+ _hoisted_49$3 = ["onClick", "disabled"];
55338
+ _hoisted_50$3 = { class: "sql-preview-section mt-4" };
55339
+ _hoisted_51$3 = { class: "section-title" };
55340
+ _hoisted_52$3 = { class: "sql-preview" };
55341
+ _hoisted_53$3 = { class: "modal-footer" };
55342
+ CUSTOM_TYPE_VALUE = "__custom__";
55260
55343
  table_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
55261
55344
  __name: "table-editor",
55262
55345
  props: {
@@ -55273,6 +55356,35 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55273
55356
  const emit = __emit;
55274
55357
  const databaseService = new DatabaseService();
55275
55358
  const { t } = useI18n();
55359
+ const dbType = computed(() => (props.connection?.type || "").toLowerCase());
55360
+ const MYSQL_LIKE_TYPES = /* @__PURE__ */ new Set([
55361
+ "mysql",
55362
+ "mariadb",
55363
+ "aurora-mysql",
55364
+ "auroramysql"
55365
+ ]);
55366
+ const POSTGRES_LIKE_TYPES = /* @__PURE__ */ new Set([
55367
+ "postgres",
55368
+ "postgresql",
55369
+ "cockroachdb",
55370
+ "aurora-postgres",
55371
+ "aurorapostgres",
55372
+ "aurora-postgresql"
55373
+ ]);
55374
+ const isMySqlLike = () => MYSQL_LIKE_TYPES.has(dbType.value);
55375
+ const isPostgresLike = () => POSTGRES_LIKE_TYPES.has(dbType.value);
55376
+ function rawType(column) {
55377
+ if (!column) return "";
55378
+ return column.type === CUSTOM_TYPE_VALUE ? column.customType || "" : column.type || "";
55379
+ }
55380
+ function sqlType(column) {
55381
+ const type = rawType(column);
55382
+ if (dbType.value === "sqlite" && column?.isAutoIncrement && /^INT$/i.test(type.trim())) return "INTEGER";
55383
+ return type;
55384
+ }
55385
+ function escapeSqlString(value) {
55386
+ return String(value ?? "").replace(/'/g, "''");
55387
+ }
55276
55388
  const columnTypes = computed(() => {
55277
55389
  if (!props.connection) return [];
55278
55390
  return getColumnTypesByName(props.connection.type);
@@ -55291,6 +55403,7 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55291
55403
  columns: [{
55292
55404
  name: "",
55293
55405
  type: "",
55406
+ customType: "",
55294
55407
  length: "",
55295
55408
  precision: null,
55296
55409
  scale: null,
@@ -55327,10 +55440,13 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55327
55440
  tableName: props.table.name || "",
55328
55441
  tableComment: props.table.comment || "",
55329
55442
  columns: columns.map((col) => {
55330
- const parsed = parseColumnType(col.type || "");
55443
+ const rawColType = col.type || "";
55444
+ const parsed = parseColumnType(rawColType);
55445
+ const isNonNumericParamType = /^[a-zA-Z\s]+\([^)]*'[^)]*\)$/.test(rawColType);
55331
55446
  return {
55332
55447
  name: col.name || "",
55333
- type: parsed.baseType,
55448
+ type: isNonNumericParamType ? CUSTOM_TYPE_VALUE : parsed.baseType,
55449
+ customType: isNonNumericParamType ? rawColType : col.customType || "",
55334
55450
  length: col.length || parsed.length || "",
55335
55451
  precision: col.precision || parsed.precision || null,
55336
55452
  scale: col.scale || parsed.scale || null,
@@ -55345,12 +55461,14 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55345
55461
  formData.value = { ...tableData };
55346
55462
  originalTableData.value = JSON.parse(JSON.stringify(tableData));
55347
55463
  } else {
55464
+ const isCreateWithPrefill = props.mode === "create" && props.table;
55348
55465
  formData.value = {
55349
- tableName: "",
55350
- tableComment: "",
55466
+ tableName: isCreateWithPrefill ? props.table.name || "" : "",
55467
+ tableComment: isCreateWithPrefill ? props.table.comment || "" : "",
55351
55468
  columns: [{
55352
55469
  name: "",
55353
55470
  type: "",
55471
+ customType: "",
55354
55472
  length: "",
55355
55473
  precision: null,
55356
55474
  scale: null,
@@ -55368,14 +55486,79 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55368
55486
  };
55369
55487
  }
55370
55488
  }
55489
+ function isColumnDefinitionChanged(newCol, originalCol) {
55490
+ return newCol.type !== originalCol.type || newCol.customType !== originalCol.customType || newCol.length !== originalCol.length || newCol.precision !== originalCol.precision || newCol.scale !== originalCol.scale || newCol.nullable !== originalCol.nullable || newCol.defaultValue !== originalCol.defaultValue || newCol.isPrimary !== originalCol.isPrimary || newCol.isAutoIncrement !== originalCol.isAutoIncrement || newCol.comment !== originalCol.comment;
55491
+ }
55492
+ function levenshtein(a, b) {
55493
+ const m = a.length;
55494
+ const n = b.length;
55495
+ if (m === 0) return n;
55496
+ if (n === 0) return m;
55497
+ let prev = new Array(n + 1).fill(0);
55498
+ let curr = new Array(n + 1).fill(0);
55499
+ for (let j = 0; j <= n; j++) prev[j] = j;
55500
+ for (let i = 1; i <= m; i++) {
55501
+ curr[0] = i;
55502
+ const aChar = a.charAt(i - 1);
55503
+ for (let j = 1; j <= n; j++) {
55504
+ const cost = aChar === b.charAt(j - 1) ? 0 : 1;
55505
+ curr[j] = Math.min(curr[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost);
55506
+ }
55507
+ const tmp = prev;
55508
+ prev = curr;
55509
+ curr = tmp;
55510
+ }
55511
+ return prev[n];
55512
+ }
55513
+ function renameNameScore(oldName, newName) {
55514
+ const a = String(oldName || "").trim().toLowerCase();
55515
+ const b = String(newName || "").trim().toLowerCase();
55516
+ if (!a || !b || a === b) return 0;
55517
+ if (a.startsWith(b) || b.startsWith(a)) return 3;
55518
+ const maxLen = Math.max(a.length, b.length);
55519
+ if (maxLen > 0 && levenshtein(a, b) <= Math.max(1, Math.floor(maxLen / 3))) return 1;
55520
+ return 0;
55521
+ }
55522
+ /**
55523
+ * 重命名检测:把「新增列」与「删除列」中名称相近的配成对。
55524
+ * 否则改名会被生成为 DROP COLUMN + ADD COLUMN,导致原数据丢失。
55525
+ */
55526
+ function matchRenamedColumns(addedColumns, deletedColumns) {
55527
+ const pairs = [];
55528
+ const usedOld = /* @__PURE__ */ new Set();
55529
+ addedColumns.forEach((newCol, newIndex) => {
55530
+ let bestOld = null;
55531
+ let bestScore = 0;
55532
+ deletedColumns.forEach((oldCol, oldIndex) => {
55533
+ if (usedOld.has(oldCol)) return;
55534
+ const score = renameNameScore(oldCol.name, newCol.name);
55535
+ if (score === 0) return;
55536
+ const total = score + (oldIndex === newIndex ? .1 : 0);
55537
+ if (total > bestScore) {
55538
+ bestScore = total;
55539
+ bestOld = oldCol;
55540
+ }
55541
+ });
55542
+ if (bestOld) {
55543
+ usedOld.add(bestOld);
55544
+ pairs.push({
55545
+ oldColumn: bestOld,
55546
+ newColumn: newCol
55547
+ });
55548
+ }
55549
+ });
55550
+ return pairs;
55551
+ }
55371
55552
  function calculateTableDiff() {
55372
55553
  const diff = {
55373
55554
  tableName: formData.value.tableName,
55374
55555
  tableCommentChanged: formData.value.tableComment !== originalTableData.value.tableComment,
55375
55556
  tableComment: formData.value.tableComment,
55557
+ columnOrder: formData.value.columns.map((c) => c.name).filter(Boolean),
55376
55558
  addedColumns: [],
55377
55559
  modifiedColumns: [],
55378
- deletedColumns: []
55560
+ deletedColumns: [],
55561
+ renamedColumns: []
55379
55562
  };
55380
55563
  const originalColumnsMap = /* @__PURE__ */ new Map();
55381
55564
  originalTableData.value.columns.forEach((col) => {
@@ -55384,20 +55567,33 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55384
55567
  formData.value.columns.forEach((newCol) => {
55385
55568
  const originalCol = originalColumnsMap.get(newCol.name);
55386
55569
  if (!originalCol) diff.addedColumns.push(newCol);
55387
- else if (newCol.type !== originalCol.type || newCol.length !== originalCol.length || newCol.precision !== originalCol.precision || newCol.scale !== originalCol.scale || newCol.nullable !== originalCol.nullable || newCol.defaultValue !== originalCol.defaultValue || newCol.isPrimary !== originalCol.isPrimary || newCol.isAutoIncrement !== originalCol.isAutoIncrement || newCol.comment !== originalCol.comment) diff.modifiedColumns.push({
55570
+ else if (isColumnDefinitionChanged(newCol, originalCol)) diff.modifiedColumns.push({
55388
55571
  oldColumn: originalCol,
55389
55572
  newColumn: newCol
55390
55573
  });
55391
55574
  });
55392
- originalTableData.value.columns.forEach((originalCol) => {
55393
- if (!formData.value.columns.some((newCol) => newCol.name === originalCol.name)) diff.deletedColumns.push(originalCol);
55394
- });
55575
+ const deletedColumns = originalTableData.value.columns.filter((originalCol) => !formData.value.columns.some((newCol) => newCol.name === originalCol.name));
55576
+ const renamedColumns = matchRenamedColumns(diff.addedColumns, deletedColumns);
55577
+ if (renamedColumns.length > 0) {
55578
+ const renamedNewNames = new Set(renamedColumns.map((r) => r.newColumn));
55579
+ const renamedOldColumns = new Set(renamedColumns.map((r) => r.oldColumn));
55580
+ diff.renamedColumns = renamedColumns;
55581
+ diff.addedColumns = diff.addedColumns.filter((col) => !renamedNewNames.has(col));
55582
+ diff.deletedColumns = deletedColumns.filter((col) => !renamedOldColumns.has(col));
55583
+ renamedColumns.forEach(({ oldColumn, newColumn }) => {
55584
+ if (isColumnDefinitionChanged(newColumn, oldColumn)) diff.modifiedColumns.push({
55585
+ oldColumn,
55586
+ newColumn
55587
+ });
55588
+ });
55589
+ } else diff.deletedColumns = deletedColumns;
55395
55590
  return diff;
55396
55591
  }
55397
55592
  function addColumn() {
55398
55593
  formData.value.columns.push({
55399
55594
  name: "",
55400
55595
  type: "",
55596
+ customType: "",
55401
55597
  length: "",
55402
55598
  precision: null,
55403
55599
  scale: null,
@@ -55419,172 +55615,172 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55419
55615
  }
55420
55616
  function generateSQL() {
55421
55617
  if (!formData.value.tableName) return "请输入表名";
55618
+ const quoteIdentifier = getQuoter();
55422
55619
  if (props.mode === "create") {
55423
- const quoteIdentifier = (name) => {
55424
- if (!props.connection) return `"${name}"`;
55425
- switch (props.connection.type.toLowerCase()) {
55426
- case "mysql": return `\`${name}\``;
55427
- case "postgres": return `"${name}"`;
55428
- case "sqlite": return `"${name}"`;
55429
- case "oracle": return `"${name.toUpperCase()}"`;
55430
- case "mssql": return `[${name}]`;
55431
- default: return `"${name}"`;
55432
- }
55433
- };
55434
- const columnsSQL = formData.value.columns.map((col) => {
55435
- if (!col.name || !col.type) return "";
55436
- let sql = `${quoteIdentifier(col.name)} ${col.type}`;
55437
- if (!col.type.includes("(") && col.length && (needsLength(col) || col.type.includes("CHAR"))) sql += `(${col.length})`;
55438
- else if (!col.type.includes("(") && col.precision) if (col.scale) sql += `(${col.precision},${col.scale})`;
55439
- else sql += `(${col.precision})`;
55440
- const isSqliteAutoIncrementPrimary = props.connection?.type.toLowerCase() === "sqlite" && col.isAutoIncrement && col.isPrimary;
55441
- if (!col.nullable && !isSqliteAutoIncrementPrimary) sql += " NOT NULL";
55442
- if (col.defaultValue) sql += ` DEFAULT ${formatDefaultValue(col.defaultValue, col.type)}`;
55443
- if (col.isAutoIncrement) switch (props.connection?.type.toLowerCase()) {
55444
- case "mysql":
55445
- sql += " AUTO_INCREMENT";
55446
- break;
55447
- case "postgres":
55448
- if (col.type.toLowerCase().includes("serial") || col.type.toLowerCase().includes("bigserial")) {} else sql += " GENERATED ALWAYS AS IDENTITY";
55449
- break;
55450
- case "sqlite":
55451
- if (col.type.toUpperCase() === "INT") sql = sql.replace(/\bINT\b/, "INTEGER");
55452
- if (col.isPrimary) sql += " PRIMARY KEY AUTOINCREMENT";
55453
- else sql += " AUTOINCREMENT";
55454
- break;
55455
- case "oracle": break;
55456
- case "mssql":
55457
- sql += " IDENTITY(1,1)";
55458
- break;
55459
- }
55460
- if (col.comment) switch (props.connection?.type.toLowerCase()) {
55461
- case "mysql":
55462
- sql += ` COMMENT '${col.comment}'`;
55463
- break;
55464
- case "postgres": break;
55465
- case "sqlite": break;
55466
- case "oracle":
55467
- sql += ` COMMENT '${col.comment}'`;
55468
- break;
55469
- case "mssql": break;
55470
- }
55471
- return sql;
55472
- }).filter((sql) => sql).join(",\n ");
55473
- const primaryKeys = formData.value.columns.filter((col) => col.isPrimary).map((col) => quoteIdentifier(col.name));
55620
+ const type = dbType.value;
55621
+ const columnsSQL = formData.value.columns.filter((col) => col.name && rawType(col)).map((col) => buildColumnDefinition(col, quoteIdentifier)).join(",\n ");
55622
+ if (!columnsSQL) return "请至少完善一个字段";
55623
+ const primaryKeys = formData.value.columns.filter((col) => col.isPrimary && col.name).map((col) => quoteIdentifier(col.name));
55624
+ const hasSqliteAutoIncrementPrimary = type === "sqlite" && formData.value.columns.some((col) => col.isAutoIncrement && col.isPrimary && col.name);
55474
55625
  let sql = `CREATE TABLE ${quoteIdentifier(formData.value.tableName)} (\n ${columnsSQL}`;
55475
- const hasSqliteAutoIncrementPrimary = props.connection?.type.toLowerCase() === "sqlite" && formData.value.columns.some((col) => col.isAutoIncrement && col.isPrimary);
55476
55626
  if (primaryKeys.length > 0 && !hasSqliteAutoIncrementPrimary) sql += `,\n PRIMARY KEY (${primaryKeys.join(", ")})`;
55477
55627
  sql += "\n)";
55478
- switch (props.connection?.type.toLowerCase()) {
55479
- case "mysql":
55480
- if (formData.value.tableComment) sql += ` COMMENT='${formData.value.tableComment}'`;
55481
- sql += " ENGINE=InnoDB DEFAULT CHARSET=utf8mb4";
55482
- break;
55483
- case "postgres": break;
55484
- case "oracle":
55485
- if (formData.value.tableComment) sql += ` COMMENT '${formData.value.tableComment}'`;
55486
- break;
55487
- case "mssql": break;
55488
- }
55489
- if (props.connection?.type.toLowerCase() === "postgres") {
55490
- const commentStatements = [];
55491
- if (formData.value.tableComment) commentStatements.push(`COMMENT ON TABLE ${quoteIdentifier(formData.value.tableName)} IS '${formData.value.tableComment}'`);
55492
- formData.value.columns.forEach((col) => {
55493
- if (col.comment) commentStatements.push(`COMMENT ON COLUMN ${quoteIdentifier(formData.value.tableName)}.${quoteIdentifier(col.name)} IS '${col.comment}'`);
55494
- });
55495
- if (commentStatements.length > 0) sql += ";\n" + commentStatements.join(";\n");
55628
+ if (isMySqlLike()) {
55629
+ if (formData.value.tableComment) sql += ` COMMENT='${escapeSqlString(formData.value.tableComment)}'`;
55630
+ sql += " ENGINE=InnoDB DEFAULT CHARSET=utf8mb4";
55496
55631
  }
55632
+ const commentStatements = [];
55633
+ if (formData.value.tableComment && (isPostgresLike() || dbType.value === "oracle")) commentStatements.push(`COMMENT ON TABLE ${quoteIdentifier(formData.value.tableName)} IS '${escapeSqlString(formData.value.tableComment)}'`);
55634
+ formData.value.columns.forEach((col) => {
55635
+ if (!col.name || !col.comment) return;
55636
+ if (isPostgresLike() || dbType.value === "oracle") commentStatements.push(`COMMENT ON COLUMN ${quoteIdentifier(formData.value.tableName)}.${quoteIdentifier(col.name)} IS '${escapeSqlString(col.comment)}'`);
55637
+ });
55638
+ if (commentStatements.length > 0) sql += ";\n" + commentStatements.join(";\n");
55497
55639
  return sql;
55498
55640
  } else {
55499
- const quoteIdentifier = (name) => {
55500
- if (!props.connection) return `"${name}"`;
55501
- switch (props.connection.type.toLowerCase()) {
55502
- case "mysql": return `\`${name}\``;
55503
- case "postgres": return `"${name}"`;
55504
- case "sqlite": return `"${name}"`;
55505
- case "oracle": return `"${name.toUpperCase()}"`;
55506
- case "mssql": return `[${name}]`;
55507
- default: return `"${name}"`;
55508
- }
55509
- };
55510
- const sqlStatements = [];
55511
- const tableName = formData.value.tableName;
55512
- if (formData.value.tableComment) switch (props.connection?.type.toLowerCase()) {
55641
+ const diff = calculateTableDiff();
55642
+ const tableName = diff.tableName;
55643
+ const statements = [];
55644
+ if (diff.tableCommentChanged && diff.tableComment) {
55645
+ if (isMySqlLike()) statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} COMMENT='${escapeSqlString(diff.tableComment)}'`);
55646
+ else if (isPostgresLike() || dbType.value === "oracle") statements.push(`COMMENT ON TABLE ${quoteIdentifier(tableName)} IS '${escapeSqlString(diff.tableComment)}'`);
55647
+ else if (dbType.value === "mssql" || dbType.value === "sqlserver") statements.push(`EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'${escapeSqlString(diff.tableComment)}', @level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'${escapeSqlString(tableName)}'`);
55648
+ }
55649
+ diff.renamedColumns.forEach(({ oldColumn, newColumn }) => {
55650
+ if (isMySqlLike()) statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} CHANGE COLUMN ${quoteIdentifier(oldColumn.name)} ${quoteIdentifier(newColumn.name)} ${sqlType(newColumn)}${getTypeParams(newColumn)}${buildColumnAttributes(newColumn)}`);
55651
+ else if (isPostgresLike()) statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} RENAME COLUMN ${quoteIdentifier(oldColumn.name)} TO ${quoteIdentifier(newColumn.name)}`);
55652
+ else if (dbType.value === "oracle") statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} RENAME COLUMN ${quoteIdentifier(oldColumn.name)} TO ${quoteIdentifier(newColumn.name)}`);
55653
+ else if (dbType.value === "mssql" || dbType.value === "sqlserver") statements.push(`EXEC sp_rename N'dbo.${escapeSqlString(tableName)}.${escapeSqlString(oldColumn.name)}', N'${escapeSqlString(newColumn.name)}', N'COLUMN'`);
55654
+ else if (dbType.value === "sqlite") statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} RENAME COLUMN ${quoteIdentifier(oldColumn.name)} TO ${quoteIdentifier(newColumn.name)}`);
55655
+ });
55656
+ diff.addedColumns.forEach((col) => {
55657
+ const def = buildColumnAttributes(col);
55658
+ if (dbType.value === "oracle") statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD (${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)}${def})`);
55659
+ else if (dbType.value === "mssql" || dbType.value === "sqlserver") statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD ${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)}${def}`);
55660
+ else statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD COLUMN ${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)}${def}`);
55661
+ const colComment = buildColumnCommentStatement(col);
55662
+ if (colComment) statements.push(colComment);
55663
+ });
55664
+ diff.modifiedColumns.forEach((modification) => {
55665
+ const col = modification.newColumn;
55666
+ const def = buildColumnAttributes(col);
55667
+ if (isMySqlLike() && diff.renamedColumns.some((r) => r.oldColumn === modification.oldColumn)) return;
55668
+ if (isMySqlLike()) statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} MODIFY COLUMN ${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)}${def}`);
55669
+ else if (isPostgresLike()) {
55670
+ statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${quoteIdentifier(col.name)} TYPE ${sqlType(col)}${getTypeParams(col)}`);
55671
+ statements.push(col.nullable ? `ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${quoteIdentifier(col.name)} DROP NOT NULL` : `ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${quoteIdentifier(col.name)} SET NOT NULL`);
55672
+ if (col.defaultValue) statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${quoteIdentifier(col.name)} SET DEFAULT ${formatDefaultValue(col.defaultValue, sqlType(col))}`);
55673
+ else statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${quoteIdentifier(col.name)} DROP DEFAULT`);
55674
+ } else if (dbType.value === "mssql" || dbType.value === "sqlserver") {
55675
+ statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)} ${col.nullable ? "NULL" : "NOT NULL"}`);
55676
+ if (col.defaultValue) statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD CONSTRAINT DF_${tableName}_${col.name} DEFAULT ${formatDefaultValue(col.defaultValue, sqlType(col))} FOR ${quoteIdentifier(col.name)}`);
55677
+ else statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} DROP CONSTRAINT DF_${tableName}_${col.name}`);
55678
+ } else if (dbType.value === "oracle") statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} MODIFY (${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)}${def})`);
55679
+ else if (dbType.value === "sqlite") statements.push(`-- SQLite 不支持直接修改列 "${col.name}",需要重建表`);
55680
+ const colComment = buildColumnCommentStatement(col);
55681
+ if (colComment) statements.push(colComment);
55682
+ });
55683
+ diff.deletedColumns.forEach((col) => {
55684
+ if (dbType.value === "sqlite") statements.push(`-- SQLite 不支持直接删除列 "${col.name}",需要重建表`);
55685
+ else statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} DROP COLUMN ${quoteIdentifier(col.name)}`);
55686
+ });
55687
+ const oldPk = originalTableData.value.columns.filter((c) => c.isPrimary).map((c) => quoteIdentifier(c.name));
55688
+ const newPk = formData.value.columns.filter((c) => c.isPrimary && c.name).map((c) => quoteIdentifier(c.name));
55689
+ if (oldPk.join(",") !== newPk.join(",")) {
55690
+ if (isMySqlLike()) {
55691
+ statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} DROP PRIMARY KEY`);
55692
+ statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD PRIMARY KEY (${newPk.join(", ")})`);
55693
+ } else if (isPostgresLike() || dbType.value === "oracle" || dbType.value === "mssql" || dbType.value === "sqlserver") {
55694
+ statements.push(`-- 需要先手动删除旧主键约束,再执行:`);
55695
+ statements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD CONSTRAINT ${quoteIdentifier(`${tableName}_pkey`)} PRIMARY KEY (${newPk.join(", ")})`);
55696
+ } else if (dbType.value === "sqlite") statements.push(`-- SQLite 修改主键需要重建表`);
55697
+ }
55698
+ if (statements.length === 0) return "没有检测到任何修改";
55699
+ return statements.join(";\n") + ";";
55700
+ }
55701
+ }
55702
+ function buildColumnAttributes(col) {
55703
+ const type = sqlType(col);
55704
+ let sql = "";
55705
+ const isSqliteAutoIncrementPrimary = dbType.value === "sqlite" && col.isAutoIncrement && col.isPrimary;
55706
+ if (!col.nullable && !isSqliteAutoIncrementPrimary) sql += " NOT NULL";
55707
+ if (col.defaultValue) sql += ` DEFAULT ${formatDefaultValue(col.defaultValue, type)}`;
55708
+ if (col.isAutoIncrement) {
55709
+ if (isMySqlLike()) sql += " AUTO_INCREMENT";
55710
+ else if (isPostgresLike()) {
55711
+ if (!type.toLowerCase().includes("serial")) sql += " GENERATED ALWAYS AS IDENTITY";
55712
+ } else if (dbType.value === "sqlite") sql += col.isPrimary ? " PRIMARY KEY AUTOINCREMENT" : " AUTOINCREMENT";
55713
+ else if (dbType.value === "oracle") {
55714
+ if (type.toLowerCase().includes("number")) sql += " GENERATED BY DEFAULT AS IDENTITY";
55715
+ } else if (dbType.value === "mssql" || dbType.value === "sqlserver") sql += " IDENTITY(1,1)";
55716
+ }
55717
+ if (col.comment && isMySqlLike()) sql += ` COMMENT '${escapeSqlString(col.comment)}'`;
55718
+ return sql;
55719
+ }
55720
+ function buildColumnDefinition(col, quoteIdentifier) {
55721
+ return `${quoteIdentifier(col.name)} ${sqlType(col)}${getTypeParams(col)}${buildColumnAttributes(col)}`;
55722
+ }
55723
+ function buildColumnCommentStatement(col) {
55724
+ if (!col.comment) return "";
55725
+ const quoteIdentifier = getQuoter();
55726
+ if (isPostgresLike() || dbType.value === "oracle") return `COMMENT ON COLUMN ${quoteIdentifier(formData.value.tableName)}.${quoteIdentifier(col.name)} IS '${escapeSqlString(col.comment)}'`;
55727
+ if (dbType.value === "mssql" || dbType.value === "sqlserver") return `EXEC sp_addextendedproperty @name=N'MS_Description', @value=N'${escapeSqlString(col.comment)}', @level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'${escapeSqlString(formData.value.tableName)}', @level2type=N'COLUMN', @level2name=N'${escapeSqlString(col.name)}'`;
55728
+ return "";
55729
+ }
55730
+ function getQuoter() {
55731
+ return (name) => {
55732
+ if (!props.connection) return `"${name}"`;
55733
+ switch (dbType.value) {
55513
55734
  case "mysql":
55514
- sqlStatements.push(`ALTER TABLE ${quoteIdentifier(tableName)} COMMENT='${formData.value.tableComment}'`);
55515
- break;
55735
+ case "mariadb":
55736
+ case "aurora-mysql":
55737
+ case "auroramysql":
55738
+ case "clickhouse":
55739
+ case "click-house": return `\`${name}\``;
55516
55740
  case "postgres":
55517
- sqlStatements.push(`COMMENT ON TABLE ${quoteIdentifier(tableName)} IS '${formData.value.tableComment}'`);
55518
- break;
55519
- case "oracle":
55520
- sqlStatements.push(`COMMENT ON TABLE ${quoteIdentifier(tableName)} IS '${formData.value.tableComment}'`);
55521
- break;
55741
+ case "postgresql":
55742
+ case "cockroachdb":
55743
+ case "aurora-postgres":
55744
+ case "aurorapostgres":
55745
+ case "aurora-postgresql":
55746
+ case "sqlite": return `"${name}"`;
55747
+ case "oracle": return `"${name.toUpperCase()}"`;
55522
55748
  case "mssql":
55523
- sqlStatements.push(`EXEC sp_addextendedproperty 'MS_Description', '${formData.value.tableComment}', 'SCHEMA', 'dbo', 'TABLE', '${tableName}'`);
55524
- break;
55525
- }
55526
- formData.value.columns.forEach((col) => {
55527
- if (!col.name || !col.type) return;
55528
- let columnSQL = `${quoteIdentifier(col.name)} ${col.type}`;
55529
- if (!col.type.includes("(") && col.length && (needsLength(col) || col.type.includes("CHAR"))) columnSQL += `(${col.length})`;
55530
- else if (!col.type.includes("(") && col.precision) if (col.scale) columnSQL += `(${col.precision},${col.scale})`;
55531
- else columnSQL += `(${col.precision})`;
55532
- if (!col.nullable) columnSQL += " NOT NULL";
55533
- else columnSQL += " NULL";
55534
- if (col.defaultValue) columnSQL += ` DEFAULT ${formatDefaultValue(col.defaultValue, col.type)}`;
55535
- let commentStatement = "";
55536
- if (col.comment) switch (props.connection?.type.toLowerCase()) {
55537
- case "mysql":
55538
- columnSQL += ` COMMENT '${col.comment}'`;
55539
- break;
55540
- case "postgres":
55541
- commentStatement = `COMMENT ON COLUMN ${quoteIdentifier(tableName)}.${quoteIdentifier(col.name)} IS '${col.comment}'`;
55542
- break;
55543
- case "oracle":
55544
- columnSQL += ` COMMENT '${col.comment}'`;
55545
- break;
55546
- case "mssql":
55547
- commentStatement = `EXEC sp_addextendedproperty 'MS_Description', '${col.comment}', 'SCHEMA', 'dbo', 'TABLE', '${tableName}', 'COLUMN', '${col.name}'`;
55548
- break;
55549
- }
55550
- switch (props.connection?.type.toLowerCase()) {
55551
- case "mysql":
55552
- sqlStatements.push(`ALTER TABLE ${quoteIdentifier(tableName)} MODIFY COLUMN ${columnSQL}`);
55553
- break;
55554
- case "postgres":
55555
- case "mssql":
55556
- sqlStatements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ALTER COLUMN ${columnSQL}`);
55557
- break;
55558
- case "oracle":
55559
- sqlStatements.push(`ALTER TABLE ${quoteIdentifier(tableName)} MODIFY ${columnSQL}`);
55560
- break;
55561
- case "sqlite":
55562
- sqlStatements.push(`-- SQLite 不支持直接修改列,需要重建表`);
55563
- break;
55564
- }
55565
- if (commentStatement) sqlStatements.push(commentStatement);
55566
- });
55567
- const primaryKeys = formData.value.columns.filter((col) => col.isPrimary).map((col) => quoteIdentifier(col.name));
55568
- if (primaryKeys.length > 0) {
55569
- sqlStatements.push(`ALTER TABLE ${quoteIdentifier(tableName)} DROP PRIMARY KEY`);
55570
- sqlStatements.push(`ALTER TABLE ${quoteIdentifier(tableName)} ADD PRIMARY KEY (${primaryKeys.join(", ")})`);
55571
- }
55572
- return sqlStatements.join(";\n") + ";";
55573
- }
55574
- }
55749
+ case "sqlserver": return `[${name}]`;
55750
+ default: return `"${name}"`;
55751
+ }
55752
+ };
55753
+ }
55754
+ const DEFAULT_KEYWORDS = /* @__PURE__ */ new Set([
55755
+ "current_timestamp",
55756
+ "now()",
55757
+ "current_date",
55758
+ "current_time",
55759
+ "localtimestamp",
55760
+ "localtime",
55761
+ "current_user",
55762
+ "sysdate",
55763
+ "systimestamp",
55764
+ "getdate()",
55765
+ "getutcdate()",
55766
+ "sysdatetime()",
55767
+ "sysdatetimeoffset()",
55768
+ "sysutcdatetime()",
55769
+ "newid()",
55770
+ "newsequentialid()",
55771
+ "gen_random_uuid()",
55772
+ "uuid_generate_v4()"
55773
+ ]);
55575
55774
  function formatDefaultValue(value, type) {
55576
55775
  if (value === null || value === void 0 || value === "") return "NULL";
55577
- const lowerValue = String(value).toLowerCase();
55578
- if ([
55579
- "current_timestamp",
55580
- "now()",
55581
- "current_date",
55582
- "current_time",
55583
- "localtimestamp",
55584
- "localtime"
55585
- ].includes(lowerValue)) return value;
55776
+ const raw = String(value).trim();
55777
+ const lower = raw.toLowerCase();
55778
+ if (lower === "null") return "NULL";
55779
+ if (DEFAULT_KEYWORDS.has(lower)) return raw;
55780
+ if (/^[a-z_][a-z0-9_]*\s*\(\s*\)$/.test(lower)) return raw;
55781
+ if (/^current_timestamp\s*\(\s*\d+\s*\)$/.test(lower)) return raw;
55586
55782
  const lowerType = type.toLowerCase();
55587
- if (isNumericType(lowerType) && !isNaN(value)) return String(value);
55783
+ if (isNumericType(lowerType) && !isNaN(Number(raw))) return raw;
55588
55784
  if (isBooleanType(lowerType)) return value ? "TRUE" : "FALSE";
55589
55785
  return `'${String(value).replace(/'/g, "''")}'`;
55590
55786
  }
@@ -55594,7 +55790,7 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55594
55790
  await modal.warning("请输入表名");
55595
55791
  return;
55596
55792
  }
55597
- if (formData.value.columns.some((col) => !col.name || !col.type)) {
55793
+ if (formData.value.columns.some((col) => !col.name || !rawType(col))) {
55598
55794
  await modal.warning("请完善所有字段信息");
55599
55795
  return;
55600
55796
  }
@@ -55608,7 +55804,7 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55608
55804
  result = await databaseService.executeQuery(props.connection.id, sql, props.database);
55609
55805
  } else {
55610
55806
  const tableDiff = calculateTableDiff();
55611
- if (tableDiff.addedColumns.length === 0 && tableDiff.modifiedColumns.length === 0 && tableDiff.deletedColumns.length === 0 && !tableDiff.tableCommentChanged) {
55807
+ if (tableDiff.addedColumns.length === 0 && tableDiff.modifiedColumns.length === 0 && tableDiff.deletedColumns.length === 0 && tableDiff.renamedColumns.length === 0 && !tableDiff.tableCommentChanged) {
55612
55808
  await modal.info("没有检测到任何修改");
55613
55809
  return;
55614
55810
  }
@@ -55651,9 +55847,16 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55651
55847
  }[category] || category;
55652
55848
  }
55653
55849
  function getSelectedType(column) {
55654
- if (!column.type) return null;
55655
- const typeName = column.type.match(/^[a-zA-Z]+/)?.[0] || column.type;
55656
- return columnTypes.value.find((t) => t.name.toLowerCase() === typeName.toLowerCase());
55850
+ const raw = rawType(column);
55851
+ if (!raw) return null;
55852
+ if (raw.includes("(")) return null;
55853
+ const lower = raw.trim().toLowerCase();
55854
+ let typeInfo = columnTypes.value.find((t) => t.name.toLowerCase() === lower);
55855
+ if (!typeInfo) {
55856
+ const typeName = lower.match(/^[a-zA-Z]+/)?.[0] || lower;
55857
+ typeInfo = columnTypes.value.find((t) => t.name.toLowerCase() === typeName);
55858
+ }
55859
+ return typeInfo || null;
55657
55860
  }
55658
55861
  function needsLength(column) {
55659
55862
  return getSelectedType(column)?.requiresLength || false;
@@ -55664,6 +55867,22 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55664
55867
  function needsScale(column) {
55665
55868
  return getSelectedType(column)?.requiresScale || false;
55666
55869
  }
55870
+ function getTypeParams(column) {
55871
+ const raw = rawType(column);
55872
+ if (!raw || raw.includes("(")) return "";
55873
+ const typeInfo = getSelectedType(column);
55874
+ if (typeInfo?.requiresPrecision) {
55875
+ const precision = column.precision || typeInfo.defaultPrecision;
55876
+ const scale = column.scale || typeInfo.defaultScale;
55877
+ if (precision == null) return "";
55878
+ return scale != null ? `(${precision},${scale})` : `(${precision})`;
55879
+ }
55880
+ if (typeInfo?.requiresLength) {
55881
+ const length = column.length || typeInfo.defaultLength;
55882
+ if (length != null) return `(${length})`;
55883
+ }
55884
+ return "";
55885
+ }
55667
55886
  function supportsAutoIncrement(column) {
55668
55887
  return getSelectedType(column)?.supportsAutoIncrement || false;
55669
55888
  }
@@ -55671,48 +55890,40 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55671
55890
  if (props.visible) initFormData();
55672
55891
  });
55673
55892
  return (_ctx, _cache) => {
55674
- return __props.visible ? (openBlock(), createElementBlock("div", {
55675
- key: 0,
55676
- class: "modal fade show",
55677
- style: {
55678
- "display": "block",
55679
- "background-color": "rgba(0,0,0,0.5)"
55680
- },
55681
- onClick: close
55682
- }, [createBaseVNode("div", {
55893
+ return __props.visible ? (openBlock(), createElementBlock("div", _hoisted_1$6, [createBaseVNode("div", {
55683
55894
  class: "modal-dialog modal-lg",
55684
55895
  style: {
55685
55896
  "width": "80%",
55686
55897
  "max-width": "none"
55687
55898
  },
55688
55899
  onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"]))
55689
- }, [createBaseVNode("div", _hoisted_1$6, [
55690
- createBaseVNode("div", _hoisted_2$6, [createBaseVNode("h5", _hoisted_3$6, [_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", {
55900
+ }, [createBaseVNode("div", _hoisted_2$6, [
55901
+ createBaseVNode("div", _hoisted_3$6, [createBaseVNode("h5", _hoisted_4$6, [_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", {
55691
55902
  type: "button",
55692
55903
  class: "btn-close",
55693
55904
  onClick: close
55694
55905
  })]),
55695
- createBaseVNode("div", _hoisted_4$6, [
55696
- createBaseVNode("div", _hoisted_5$6, [createBaseVNode("h6", _hoisted_6$6, toDisplayString(_ctx.$t("tableEditor.tableInfo")), 1), createBaseVNode("div", _hoisted_7$6, [createBaseVNode("div", _hoisted_8$6, [createBaseVNode("div", _hoisted_9$6, [createBaseVNode("label", _hoisted_10$6, toDisplayString(_ctx.$t("tableEditor.tableNameLabel")), 1), withDirectives(createBaseVNode("input", {
55906
+ createBaseVNode("div", _hoisted_5$6, [
55907
+ createBaseVNode("div", _hoisted_6$6, [createBaseVNode("h6", _hoisted_7$6, toDisplayString(_ctx.$t("tableEditor.tableInfo")), 1), createBaseVNode("div", _hoisted_8$6, [createBaseVNode("div", _hoisted_9$6, [createBaseVNode("div", _hoisted_10$6, [createBaseVNode("label", _hoisted_11$6, toDisplayString(_ctx.$t("tableEditor.tableNameLabel")), 1), withDirectives(createBaseVNode("input", {
55697
55908
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => formData.value.tableName = $event),
55698
55909
  type: "text",
55699
55910
  class: "form-control",
55700
55911
  disabled: __props.mode === "edit",
55701
55912
  placeholder: _ctx.$t("tableEditor.tableNamePlaceholder")
55702
- }, null, 8, _hoisted_11$6), [[vModelText, formData.value.tableName]])])]), createBaseVNode("div", _hoisted_12$6, [createBaseVNode("div", _hoisted_13$6, [createBaseVNode("label", _hoisted_14$6, toDisplayString(_ctx.$t("tableEditor.tableCommentLabel")), 1), withDirectives(createBaseVNode("input", {
55913
+ }, null, 8, _hoisted_12$6), [[vModelText, formData.value.tableName]])])]), createBaseVNode("div", _hoisted_13$6, [createBaseVNode("div", _hoisted_14$6, [createBaseVNode("label", _hoisted_15$6, toDisplayString(_ctx.$t("tableEditor.tableCommentLabel")), 1), withDirectives(createBaseVNode("input", {
55703
55914
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => formData.value.tableComment = $event),
55704
55915
  type: "text",
55705
55916
  class: "form-control",
55706
55917
  placeholder: _ctx.$t("tableEditor.tableCommentPlaceholder")
55707
- }, null, 8, _hoisted_15$6), [[vModelText, formData.value.tableComment]])])])])]),
55708
- createBaseVNode("div", _hoisted_16$6, [createBaseVNode("div", _hoisted_17$6, [createBaseVNode("h6", _hoisted_18$6, toDisplayString(_ctx.$t("tableEditor.columnManagement")), 1), createBaseVNode("button", {
55918
+ }, null, 8, _hoisted_16$6), [[vModelText, formData.value.tableComment]])])])])]),
55919
+ createBaseVNode("div", _hoisted_17$6, [createBaseVNode("div", _hoisted_18$6, [createBaseVNode("h6", _hoisted_19$6, toDisplayString(_ctx.$t("tableEditor.columnManagement")), 1), createBaseVNode("button", {
55709
55920
  class: "btn btn-success btn-sm",
55710
55921
  onClick: addColumn
55711
- }, [_cache[4] || (_cache[4] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableEditor.addColumn")), 1)])]), createBaseVNode("div", _hoisted_19$6, [createBaseVNode("table", _hoisted_20$6, [createBaseVNode("thead", _hoisted_21$6, [createBaseVNode("tr", null, [
55922
+ }, [_cache[4] || (_cache[4] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableEditor.addColumn")), 1)])]), createBaseVNode("div", _hoisted_20$6, [createBaseVNode("table", _hoisted_21$6, [createBaseVNode("thead", null, [createBaseVNode("tr", null, [
55712
55923
  createBaseVNode("th", _hoisted_22$6, toDisplayString(_ctx.$t("tableEditor.columnNameHeader")), 1),
55713
55924
  createBaseVNode("th", _hoisted_23$6, toDisplayString(_ctx.$t("tableEditor.dataTypeHeader")), 1),
55714
55925
  createBaseVNode("th", _hoisted_24$6, toDisplayString(_ctx.$t("tableEditor.lengthPrecisionHeader")), 1),
55715
- createBaseVNode("th", _hoisted_25$5, toDisplayString(_ctx.$t("tableEditor.nullableHeader")), 1),
55926
+ createBaseVNode("th", _hoisted_25$6, toDisplayString(_ctx.$t("tableEditor.nullableHeader")), 1),
55716
55927
  createBaseVNode("th", _hoisted_26$5, toDisplayString(_ctx.$t("tableEditor.defaultHeader")), 1),
55717
55928
  createBaseVNode("th", _hoisted_27$5, toDisplayString(_ctx.$t("tableEditor.primaryKeyHeader")), 1),
55718
55929
  createBaseVNode("th", _hoisted_28$5, toDisplayString(_ctx.$t("tableEditor.autoIncHeader")), 1),
@@ -55729,79 +55940,89 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55729
55940
  createBaseVNode("td", null, [withDirectives(createBaseVNode("select", {
55730
55941
  "onUpdate:modelValue": ($event) => column.type = $event,
55731
55942
  class: "form-select form-select-sm"
55732
- }, [createBaseVNode("option", _hoisted_32$4, toDisplayString(_ctx.$t("tableEditor.selectType")), 1), (openBlock(true), createElementBlock(Fragment, null, renderList(columnTypesByCategory.value, (types, category) => {
55733
- return openBlock(), createElementBlock("optgroup", {
55734
- key: category,
55735
- label: getCategoryLabel(category)
55736
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(types, (type) => {
55737
- return openBlock(), createElementBlock("option", {
55738
- key: type.name,
55739
- value: type.name
55740
- }, toDisplayString(type.label), 9, _hoisted_34$4);
55741
- }), 128))], 8, _hoisted_33$4);
55742
- }), 128))], 8, _hoisted_31$4), [[vModelSelect, column.type]])]),
55743
- createBaseVNode("td", null, [needsLength(column) || needsPrecision(column) ? (openBlock(), createElementBlock("div", _hoisted_35$4, [
55943
+ }, [
55944
+ createBaseVNode("option", _hoisted_32$4, toDisplayString(_ctx.$t("tableEditor.selectType")), 1),
55945
+ (openBlock(true), createElementBlock(Fragment, null, renderList(columnTypesByCategory.value, (types, category) => {
55946
+ return openBlock(), createElementBlock("optgroup", {
55947
+ key: category,
55948
+ label: getCategoryLabel(category)
55949
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(types, (type) => {
55950
+ return openBlock(), createElementBlock("option", {
55951
+ key: type.name,
55952
+ value: type.name
55953
+ }, toDisplayString(type.label), 9, _hoisted_34$4);
55954
+ }), 128))], 8, _hoisted_33$4);
55955
+ }), 128)),
55956
+ createBaseVNode("option", { value: CUSTOM_TYPE_VALUE }, toDisplayString(_ctx.$t("tableEditor.customType")), 1)
55957
+ ], 8, _hoisted_31$4), [[vModelSelect, column.type]]), column.type === CUSTOM_TYPE_VALUE ? withDirectives((openBlock(), createElementBlock("input", {
55958
+ key: 0,
55959
+ "onUpdate:modelValue": ($event) => column.customType = $event,
55960
+ type: "text",
55961
+ class: "form-control form-control-sm mt-1",
55962
+ placeholder: _ctx.$t("tableEditor.customTypePlaceholder")
55963
+ }, null, 8, _hoisted_35$4)), [[vModelText, column.customType]]) : createCommentVNode("", true)]),
55964
+ createBaseVNode("td", null, [needsLength(column) || needsPrecision(column) ? (openBlock(), createElementBlock("div", _hoisted_36$4, [
55744
55965
  needsLength(column) ? withDirectives((openBlock(), createElementBlock("input", {
55745
55966
  key: 0,
55746
55967
  "onUpdate:modelValue": ($event) => column.length = $event,
55747
55968
  type: "number",
55748
55969
  class: "form-control form-control-sm",
55749
55970
  placeholder: _ctx.$t("tableEditor.lengthPlaceholder")
55750
- }, null, 8, _hoisted_36$4)), [[vModelText, column.length]]) : createCommentVNode("", true),
55971
+ }, null, 8, _hoisted_37$4)), [[vModelText, column.length]]) : createCommentVNode("", true),
55751
55972
  needsPrecision(column) ? withDirectives((openBlock(), createElementBlock("input", {
55752
55973
  key: 1,
55753
55974
  "onUpdate:modelValue": ($event) => column.precision = $event,
55754
55975
  type: "number",
55755
55976
  class: "form-control form-control-sm",
55756
55977
  placeholder: _ctx.$t("tableEditor.precisionPlaceholder")
55757
- }, null, 8, _hoisted_37$4)), [[vModelText, column.precision]]) : createCommentVNode("", true),
55978
+ }, null, 8, _hoisted_38$4)), [[vModelText, column.precision]]) : createCommentVNode("", true),
55758
55979
  needsScale(column) ? withDirectives((openBlock(), createElementBlock("input", {
55759
55980
  key: 2,
55760
55981
  "onUpdate:modelValue": ($event) => column.scale = $event,
55761
55982
  type: "number",
55762
55983
  class: "form-control form-control-sm",
55763
55984
  placeholder: _ctx.$t("tableEditor.scalePlaceholder")
55764
- }, null, 8, _hoisted_38$4)), [[vModelText, column.scale]]) : createCommentVNode("", true)
55765
- ])) : (openBlock(), createElementBlock("span", _hoisted_39$4, "-"))]),
55766
- createBaseVNode("td", null, [createBaseVNode("div", _hoisted_40$4, [withDirectives(createBaseVNode("input", {
55985
+ }, null, 8, _hoisted_39$4)), [[vModelText, column.scale]]) : createCommentVNode("", true)
55986
+ ])) : (openBlock(), createElementBlock("span", _hoisted_40$4, "-"))]),
55987
+ createBaseVNode("td", null, [createBaseVNode("div", _hoisted_41$4, [withDirectives(createBaseVNode("input", {
55767
55988
  "onUpdate:modelValue": ($event) => column.nullable = $event,
55768
55989
  type: "checkbox",
55769
55990
  class: "form-check-input"
55770
- }, null, 8, _hoisted_41$4), [[vModelCheckbox, column.nullable]])])]),
55991
+ }, null, 8, _hoisted_42$4), [[vModelCheckbox, column.nullable]])])]),
55771
55992
  createBaseVNode("td", null, [withDirectives(createBaseVNode("input", {
55772
55993
  "onUpdate:modelValue": ($event) => column.defaultValue = $event,
55773
55994
  type: "text",
55774
55995
  class: "form-control form-control-sm",
55775
55996
  placeholder: _ctx.$t("tableEditor.defaultHeader")
55776
- }, null, 8, _hoisted_42$4), [[vModelText, column.defaultValue]])]),
55777
- createBaseVNode("td", null, [createBaseVNode("div", _hoisted_43$4, [withDirectives(createBaseVNode("input", {
55997
+ }, null, 8, _hoisted_43$4), [[vModelText, column.defaultValue]])]),
55998
+ createBaseVNode("td", null, [createBaseVNode("div", _hoisted_44$4, [withDirectives(createBaseVNode("input", {
55778
55999
  "onUpdate:modelValue": ($event) => column.isPrimary = $event,
55779
56000
  type: "checkbox",
55780
56001
  class: "form-check-input",
55781
56002
  onChange: ($event) => onPrimaryKeyChange(column, index)
55782
- }, null, 40, _hoisted_44$4), [[vModelCheckbox, column.isPrimary]])])]),
55783
- createBaseVNode("td", null, [createBaseVNode("div", _hoisted_45$4, [withDirectives(createBaseVNode("input", {
56003
+ }, null, 40, _hoisted_45$4), [[vModelCheckbox, column.isPrimary]])])]),
56004
+ createBaseVNode("td", null, [createBaseVNode("div", _hoisted_46$4, [withDirectives(createBaseVNode("input", {
55784
56005
  "onUpdate:modelValue": ($event) => column.isAutoIncrement = $event,
55785
56006
  type: "checkbox",
55786
56007
  class: "form-check-input",
55787
56008
  disabled: !column.isPrimary || !supportsAutoIncrement(column)
55788
- }, null, 8, _hoisted_46$4), [[vModelCheckbox, column.isAutoIncrement]])])]),
56009
+ }, null, 8, _hoisted_47$4), [[vModelCheckbox, column.isAutoIncrement]])])]),
55789
56010
  createBaseVNode("td", null, [withDirectives(createBaseVNode("input", {
55790
56011
  "onUpdate:modelValue": ($event) => column.comment = $event,
55791
56012
  type: "text",
55792
56013
  class: "form-control form-control-sm",
55793
56014
  placeholder: _ctx.$t("tableEditor.fieldComment")
55794
- }, null, 8, _hoisted_47$4), [[vModelText, column.comment]])]),
56015
+ }, null, 8, _hoisted_48$3), [[vModelText, column.comment]])]),
55795
56016
  createBaseVNode("td", null, [createBaseVNode("button", {
55796
56017
  class: "btn btn-outline-danger btn-sm",
55797
56018
  onClick: ($event) => removeColumn(index),
55798
56019
  disabled: formData.value.columns.length <= 1
55799
- }, [..._cache[5] || (_cache[5] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_48$3)])
56020
+ }, [..._cache[5] || (_cache[5] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_49$3)])
55800
56021
  ]);
55801
56022
  }), 128))])])])]),
55802
- createBaseVNode("div", _hoisted_49$3, [createBaseVNode("h6", _hoisted_50$3, toDisplayString(_ctx.$t("tableEditor.sqlPreview")), 1), createBaseVNode("pre", _hoisted_51$3, toDisplayString(generateSQL()), 1)])
56023
+ createBaseVNode("div", _hoisted_50$3, [createBaseVNode("h6", _hoisted_51$3, toDisplayString(_ctx.$t("tableEditor.sqlPreview")), 1), createBaseVNode("pre", _hoisted_52$3, toDisplayString(generateSQL()), 1)])
55803
56024
  ]),
55804
- createBaseVNode("div", _hoisted_52$3, [createBaseVNode("button", {
56025
+ createBaseVNode("div", _hoisted_53$3, [createBaseVNode("button", {
55805
56026
  type: "button",
55806
56027
  class: "btn btn-secondary",
55807
56028
  onClick: close
@@ -55816,21 +56037,21 @@ var init_table_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55816
56037
  });
55817
56038
  }));
55818
56039
  //#endregion
55819
- //#region src/platform/database/components/table-editor.vue?vue&type=style&index=0&scoped=e8059709&lang.css
55820
- var init_table_editor_vue_vue_type_style_index_0_scoped_e8059709_lang = __esmMin((() => {}));
56040
+ //#region src/platform/database/components/table-editor.vue?vue&type=style&index=0&scoped=b80d5611&lang.css
56041
+ var init_table_editor_vue_vue_type_style_index_0_scoped_b80d5611_lang = __esmMin((() => {}));
55821
56042
  //#endregion
55822
56043
  //#region src/platform/database/components/table-editor.vue
55823
56044
  var table_editor_default;
55824
56045
  var init_table_editor = __esmMin((() => {
55825
56046
  init_table_editor_vue_vue_type_script_setup_true_lang();
55826
56047
  init_table_editor_vue_vue_type_script_setup_true_lang();
55827
- init_table_editor_vue_vue_type_style_index_0_scoped_e8059709_lang();
56048
+ init_table_editor_vue_vue_type_style_index_0_scoped_b80d5611_lang();
55828
56049
  init__plugin_vue_export_helper();
55829
- table_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-e8059709"]]);
56050
+ table_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-b80d5611"]]);
55830
56051
  }));
55831
56052
  //#endregion
55832
56053
  //#region src/platform/database/components/db-tools.vue?vue&type=script&setup=true&lang.ts
55833
- 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$4, _hoisted_26$4, _hoisted_27$4, _hoisted_28$4, _hoisted_29$4, _hoisted_30$3, _hoisted_31$3, _hoisted_32$3, _hoisted_33$3, _hoisted_34$3, _hoisted_35$3, _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$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$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;
56054
+ 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$3, _hoisted_31$3, _hoisted_32$3, _hoisted_33$3, _hoisted_34$3, _hoisted_35$3, _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$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$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;
55834
56055
  var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55835
56056
  init_vue_runtime_esm_bundler();
55836
56057
  init_vue_i18n();
@@ -55864,7 +56085,7 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
55864
56085
  class: "tool-component-area"
55865
56086
  };
55866
56087
  _hoisted_24$5 = { class: "component-header" };
55867
- _hoisted_25$4 = { class: "component-title" };
56088
+ _hoisted_25$5 = { class: "component-title" };
55868
56089
  _hoisted_26$4 = {
55869
56090
  key: 0,
55870
56091
  class: "tool-component sync-component"
@@ -56422,7 +56643,7 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56422
56643
  createBaseVNode("div", _hoisted_4$5, [
56423
56644
  createBaseVNode("div", _hoisted_5$5, [createBaseVNode("h6", _hoisted_6$5, [_cache[23] || (_cache[23] = createBaseVNode("i", { class: "bi bi-shield-check" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.dataBackup")), 1)]), createBaseVNode("div", _hoisted_7$5, [
56424
56645
  createBaseVNode("button", {
56425
- class: "btn btn-outline-primary btn-sm",
56646
+ class: "btn btn-outline-secondary btn-sm",
56426
56647
  onClick: backupDatabase
56427
56648
  }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-download" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.backupDatabase")), 1)]),
56428
56649
  createBaseVNode("button", {
@@ -56430,45 +56651,45 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56430
56651
  onClick: showRestoreModal
56431
56652
  }, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-upload" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.restoreDatabase")), 1)]),
56432
56653
  createBaseVNode("button", {
56433
- class: "btn btn-outline-info btn-sm",
56654
+ class: "btn btn-outline-secondary btn-sm",
56434
56655
  onClick: showScheduleModal
56435
56656
  }, [_cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-clock" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.scheduledBackup")), 1)])
56436
56657
  ])]),
56437
56658
  createBaseVNode("div", _hoisted_8$5, [createBaseVNode("h6", _hoisted_9$5, [_cache[27] || (_cache[27] = createBaseVNode("i", { class: "bi bi-people" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.userManagement")), 1)]), createBaseVNode("div", _hoisted_10$5, [
56438
56659
  createBaseVNode("button", {
56439
- class: "btn btn-outline-success btn-sm",
56660
+ class: "btn btn-outline-secondary btn-sm",
56440
56661
  onClick: showUsersList
56441
56662
  }, [_cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-person-lines-fill" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.userList")), 1)]),
56442
56663
  createBaseVNode("button", {
56443
- class: "btn btn-outline-primary btn-sm",
56664
+ class: "btn btn-outline-secondary btn-sm",
56444
56665
  onClick: showCreateUserModal
56445
56666
  }, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-person-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.createUser")), 1)]),
56446
56667
  createBaseVNode("button", {
56447
- class: "btn btn-outline-warning btn-sm",
56668
+ class: "btn btn-outline-secondary btn-sm",
56448
56669
  onClick: showPermissionsModal
56449
56670
  }, [_cache[30] || (_cache[30] = createBaseVNode("i", { class: "bi bi-key" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.permissionMgmt")), 1)])
56450
56671
  ])]),
56451
56672
  createBaseVNode("div", _hoisted_11$5, [createBaseVNode("h6", _hoisted_12$5, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-speedometer2" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.perfMonitor")), 1)]), createBaseVNode("div", _hoisted_13$5, [
56452
56673
  createBaseVNode("button", {
56453
- class: "btn btn-outline-info btn-sm",
56674
+ class: "btn btn-outline-secondary btn-sm",
56454
56675
  onClick: showProcessList
56455
56676
  }, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-activity" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.processList")), 1)]),
56456
56677
  createBaseVNode("button", {
56457
- class: "btn btn-outline-warning btn-sm",
56678
+ class: "btn btn-outline-secondary btn-sm",
56458
56679
  onClick: showSlowQueries
56459
56680
  }, [_cache[33] || (_cache[33] = createBaseVNode("i", { class: "bi bi-hourglass-split" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.slowQueries")), 1)]),
56460
56681
  createBaseVNode("button", {
56461
- class: "btn btn-outline-danger btn-sm",
56682
+ class: "btn btn-outline-secondary btn-sm",
56462
56683
  onClick: showConnectionsList
56463
56684
  }, [_cache[34] || (_cache[34] = createBaseVNode("i", { class: "bi bi-diagram-3" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.connectionCount")), 1)])
56464
56685
  ])]),
56465
56686
  createBaseVNode("div", _hoisted_14$5, [createBaseVNode("h6", _hoisted_15$5, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-gear-wide-connected" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.dbOptimization")), 1)]), createBaseVNode("div", _hoisted_16$5, [
56466
56687
  createBaseVNode("button", {
56467
- class: "btn btn-outline-success btn-sm",
56688
+ class: "btn btn-outline-secondary btn-sm",
56468
56689
  onClick: optimizeDatabase
56469
56690
  }, [_cache[36] || (_cache[36] = createBaseVNode("i", { class: "bi bi-lightning-charge" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.optimizeDatabase")), 1)]),
56470
56691
  createBaseVNode("button", {
56471
- class: "btn btn-outline-primary btn-sm",
56692
+ class: "btn btn-outline-secondary btn-sm",
56472
56693
  onClick: analyzeTables
56473
56694
  }, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-search" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.analyzeTables")), 1)]),
56474
56695
  createBaseVNode("button", {
@@ -56476,27 +56697,27 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56476
56697
  onClick: repairTables
56477
56698
  }, [_cache[38] || (_cache[38] = createBaseVNode("i", { class: "bi bi-tools" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.repairTables")), 1)]),
56478
56699
  createBaseVNode("button", {
56479
- class: "btn btn-outline-info btn-sm",
56700
+ class: "btn btn-outline-secondary btn-sm",
56480
56701
  onClick: clearLogs
56481
56702
  }, [_cache[39] || (_cache[39] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.clearLogs")), 1)])
56482
56703
  ])]),
56483
56704
  createBaseVNode("div", _hoisted_17$5, [createBaseVNode("h6", _hoisted_18$5, [_cache[40] || (_cache[40] = createBaseVNode("i", { class: "bi bi-arrow-left-right" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.dataMigration")), 1)]), createBaseVNode("div", _hoisted_19$5, [
56484
56705
  createBaseVNode("button", {
56485
- class: "btn btn-outline-primary btn-sm",
56706
+ class: "btn btn-outline-secondary btn-sm",
56486
56707
  onClick: showExportModal
56487
56708
  }, [_cache[41] || (_cache[41] = createBaseVNode("i", { class: "bi bi-box-arrow-up-right" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.exportStructure")), 1)]),
56488
56709
  createBaseVNode("button", {
56489
- class: "btn btn-outline-success btn-sm",
56710
+ class: "btn btn-outline-secondary btn-sm",
56490
56711
  onClick: showImportModal
56491
56712
  }, [_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-box-arrow-in-down" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.importStructure")), 1)]),
56492
56713
  createBaseVNode("button", {
56493
- class: "btn btn-outline-warning btn-sm",
56714
+ class: "btn btn-outline-secondary btn-sm",
56494
56715
  onClick: _cache[0] || (_cache[0] = ($event) => selectTool("sync"))
56495
56716
  }, [_cache[43] || (_cache[43] = createBaseVNode("i", { class: "bi bi-arrow-repeat" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.dataSync")), 1)])
56496
56717
  ])]),
56497
56718
  createBaseVNode("div", _hoisted_20$5, [createBaseVNode("h6", _hoisted_21$5, [_cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-heart-pulse" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.healthCheck")), 1)]), createBaseVNode("div", _hoisted_22$5, [
56498
56719
  createBaseVNode("button", {
56499
- class: "btn btn-outline-info btn-sm",
56720
+ class: "btn btn-outline-secondary btn-sm",
56500
56721
  onClick: runHealthCheck
56501
56722
  }, [_cache[45] || (_cache[45] = createBaseVNode("i", { class: "bi bi-clipboard-check" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.healthCheck")), 1)]),
56502
56723
  createBaseVNode("button", {
@@ -56504,12 +56725,12 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56504
56725
  onClick: showStatistics
56505
56726
  }, [_cache[46] || (_cache[46] = createBaseVNode("i", { class: "bi bi-bar-chart" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.dataStatistics")), 1)]),
56506
56727
  createBaseVNode("button", {
56507
- class: "btn btn-outline-warning btn-sm",
56728
+ class: "btn btn-outline-secondary btn-sm",
56508
56729
  onClick: showAuditLog
56509
56730
  }, [_cache[47] || (_cache[47] = createBaseVNode("i", { class: "bi bi-journal-text" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("dbTools.auditLog")), 1)])
56510
56731
  ])])
56511
56732
  ]),
56512
- selectedTool.value ? (openBlock(), createElementBlock("div", _hoisted_23$5, [createBaseVNode("div", _hoisted_24$5, [createBaseVNode("h6", _hoisted_25$4, [createBaseVNode("i", { class: normalizeClass(getToolIcon(selectedTool.value)) }, null, 2), createTextVNode(" " + toDisplayString(getToolTitle(selectedTool.value)), 1)]), createBaseVNode("button", {
56733
+ selectedTool.value ? (openBlock(), createElementBlock("div", _hoisted_23$5, [createBaseVNode("div", _hoisted_24$5, [createBaseVNode("h6", _hoisted_25$5, [createBaseVNode("i", { class: normalizeClass(getToolIcon(selectedTool.value)) }, null, 2), createTextVNode(" " + toDisplayString(getToolTitle(selectedTool.value)), 1)]), createBaseVNode("button", {
56513
56734
  class: "btn btn-outline-secondary btn-sm",
56514
56735
  onClick: closeTool
56515
56736
  }, [_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, [
@@ -56563,7 +56784,7 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56563
56784
  createBaseVNode("div", _hoisted_53$2, [createBaseVNode("label", _hoisted_54$2, toDisplayString(_ctx.$t("dbTools.dbTypeLabel")), 1), withDirectives(createBaseVNode("select", {
56564
56785
  class: "form-select",
56565
56786
  "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => syncConfig.value.target.dbType = $event)
56566
- }, [..._cache[51] || (_cache[51] = [createStaticVNode("<option value=\"mysql\" data-v-7577f853>MySQL</option><option value=\"postgresql\" data-v-7577f853>PostgreSQL</option><option value=\"sqlite\" data-v-7577f853>SQLite</option><option value=\"sqlserver\" data-v-7577f853>SQL Server</option><option value=\"oracle\" data-v-7577f853>Oracle</option>", 5)])], 512), [[vModelSelect, syncConfig.value.target.dbType]])]),
56787
+ }, [..._cache[51] || (_cache[51] = [createStaticVNode("<option value=\"mysql\" data-v-a123948c>MySQL</option><option value=\"postgresql\" data-v-a123948c>PostgreSQL</option><option value=\"sqlite\" data-v-a123948c>SQLite</option><option value=\"sqlserver\" data-v-a123948c>SQL Server</option><option value=\"oracle\" data-v-a123948c>Oracle</option>", 5)])], 512), [[vModelSelect, syncConfig.value.target.dbType]])]),
56567
56788
  createBaseVNode("div", _hoisted_55$2, [createBaseVNode("label", _hoisted_56$2, toDisplayString(_ctx.$t("dbTools.hostLabel")), 1), withDirectives(createBaseVNode("input", {
56568
56789
  type: "text",
56569
56790
  class: "form-control",
@@ -56703,21 +56924,21 @@ var init_db_tools_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56703
56924
  });
56704
56925
  }));
56705
56926
  //#endregion
56706
- //#region src/platform/database/components/db-tools.vue?vue&type=style&index=0&scoped=7577f853&lang.css
56707
- var init_db_tools_vue_vue_type_style_index_0_scoped_7577f853_lang = __esmMin((() => {}));
56927
+ //#region src/platform/database/components/db-tools.vue?vue&type=style&index=0&scoped=a123948c&lang.css
56928
+ var init_db_tools_vue_vue_type_style_index_0_scoped_a123948c_lang = __esmMin((() => {}));
56708
56929
  //#endregion
56709
56930
  //#region src/platform/database/components/db-tools.vue
56710
56931
  var db_tools_default;
56711
56932
  var init_db_tools = __esmMin((() => {
56712
56933
  init_db_tools_vue_vue_type_script_setup_true_lang();
56713
56934
  init_db_tools_vue_vue_type_script_setup_true_lang();
56714
- init_db_tools_vue_vue_type_style_index_0_scoped_7577f853_lang();
56935
+ init_db_tools_vue_vue_type_style_index_0_scoped_a123948c_lang();
56715
56936
  init__plugin_vue_export_helper();
56716
- db_tools_default = /*#__PURE__*/ _plugin_vue_export_helper_default(db_tools_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7577f853"]]);
56937
+ db_tools_default = /*#__PURE__*/ _plugin_vue_export_helper_default(db_tools_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a123948c"]]);
56717
56938
  }));
56718
56939
  //#endregion
56719
56940
  //#region src/platform/database/components/database-detail.vue?vue&type=script&setup=true&lang.ts
56720
- 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$3, _hoisted_26$3, _hoisted_27$3, _hoisted_28$3, _hoisted_29$3, _hoisted_30$2, _hoisted_31$2, _hoisted_32$2, _hoisted_33$2, _hoisted_34$2, _hoisted_35$2, _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, _hoisted_75, _hoisted_76, _hoisted_77, _hoisted_78, _hoisted_79, _hoisted_80, _hoisted_81, _hoisted_82, _hoisted_83, _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, database_detail_vue_vue_type_script_setup_true_lang_default;
56941
+ 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$2, _hoisted_31$2, _hoisted_32$2, _hoisted_33$2, _hoisted_34$2, _hoisted_35$2, _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, _hoisted_75, _hoisted_76, _hoisted_77, _hoisted_78, _hoisted_79, _hoisted_80, _hoisted_81, _hoisted_82, _hoisted_83, _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, database_detail_vue_vue_type_script_setup_true_lang_default;
56721
56942
  var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56722
56943
  init_vue_runtime_esm_bundler();
56723
56944
  init_vue_i18n();
@@ -56733,173 +56954,174 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56733
56954
  _hoisted_5$4 = { class: "database-meta" };
56734
56955
  _hoisted_6$4 = { class: "database-name" };
56735
56956
  _hoisted_7$4 = { class: "connection-info" };
56736
- _hoisted_8$4 = { class: "connection-name" };
56737
- _hoisted_9$4 = { class: "connection-type" };
56738
- _hoisted_10$4 = { class: "database-stats" };
56739
- _hoisted_11$4 = { class: "stat-item" };
56740
- _hoisted_12$4 = { class: "stat-value" };
56741
- _hoisted_13$4 = { class: "stat-label" };
56742
- _hoisted_14$4 = { class: "stat-item" };
56743
- _hoisted_15$4 = { class: "stat-value" };
56744
- _hoisted_16$4 = { class: "stat-label" };
56745
- _hoisted_17$4 = { class: "database-tabs" };
56746
- _hoisted_18$4 = { class: "nav nav-tabs" };
56747
- _hoisted_19$4 = { class: "nav-item" };
56957
+ _hoisted_8$4 = ["title"];
56958
+ _hoisted_9$4 = { class: "crumb crumb-current" };
56959
+ _hoisted_10$4 = { class: "connection-type ms-2" };
56960
+ _hoisted_11$4 = { class: "database-stats" };
56961
+ _hoisted_12$4 = { class: "stat-item" };
56962
+ _hoisted_13$4 = { class: "stat-value" };
56963
+ _hoisted_14$4 = { class: "stat-label" };
56964
+ _hoisted_15$4 = { class: "stat-item" };
56965
+ _hoisted_16$4 = { class: "stat-value" };
56966
+ _hoisted_17$4 = { class: "stat-label" };
56967
+ _hoisted_18$4 = { class: "database-tabs" };
56968
+ _hoisted_19$4 = { class: "nav nav-tabs" };
56748
56969
  _hoisted_20$4 = { class: "nav-item" };
56749
56970
  _hoisted_21$4 = { class: "nav-item" };
56750
56971
  _hoisted_22$4 = { class: "nav-item" };
56751
56972
  _hoisted_23$4 = { class: "nav-item" };
56752
- _hoisted_24$4 = { class: "tab-content" };
56753
- _hoisted_25$3 = { class: "tab-panel" };
56754
- _hoisted_26$3 = { class: "tables-actions mb-3" };
56755
- _hoisted_27$3 = {
56973
+ _hoisted_24$4 = { class: "nav-item" };
56974
+ _hoisted_25$4 = { class: "tab-content" };
56975
+ _hoisted_26$3 = { class: "tab-panel" };
56976
+ _hoisted_27$3 = { class: "tables-actions mb-3" };
56977
+ _hoisted_28$3 = {
56756
56978
  key: 0,
56757
56979
  class: "loading-state"
56758
56980
  };
56759
- _hoisted_28$3 = {
56981
+ _hoisted_29$3 = {
56760
56982
  class: "spinner-border",
56761
56983
  role: "status"
56762
56984
  };
56763
- _hoisted_29$3 = { class: "visually-hidden" };
56764
- _hoisted_30$2 = { key: 1 };
56765
- _hoisted_31$2 = { class: "table-grid" };
56766
- _hoisted_32$2 = ["onClick"];
56767
- _hoisted_33$2 = { class: "card-header" };
56768
- _hoisted_34$2 = { class: "table-info" };
56769
- _hoisted_35$2 = { class: "table-name-wrapper" };
56770
- _hoisted_36$2 = ["title"];
56771
- _hoisted_37$2 = { class: "table-engine" };
56772
- _hoisted_38$2 = ["title"];
56773
- _hoisted_39$2 = { class: "card-body" };
56774
- _hoisted_40$2 = { class: "table-stats" };
56775
- _hoisted_41$2 = {
56985
+ _hoisted_30$2 = { class: "visually-hidden" };
56986
+ _hoisted_31$2 = { key: 1 };
56987
+ _hoisted_32$2 = { class: "table-grid" };
56988
+ _hoisted_33$2 = ["onClick"];
56989
+ _hoisted_34$2 = { class: "card-header" };
56990
+ _hoisted_35$2 = { class: "table-info" };
56991
+ _hoisted_36$2 = { class: "table-name-wrapper" };
56992
+ _hoisted_37$2 = ["title"];
56993
+ _hoisted_38$2 = { class: "table-engine" };
56994
+ _hoisted_39$2 = ["title"];
56995
+ _hoisted_40$2 = { class: "card-body" };
56996
+ _hoisted_41$2 = { class: "table-stats" };
56997
+ _hoisted_42$2 = {
56776
56998
  key: 0,
56777
56999
  class: "stat"
56778
57000
  };
56779
- _hoisted_42$2 = { class: "stat-label" };
56780
- _hoisted_43$2 = { class: "stat-value" };
56781
- _hoisted_44$2 = {
57001
+ _hoisted_43$2 = { class: "stat-label" };
57002
+ _hoisted_44$2 = { class: "stat-value" };
57003
+ _hoisted_45$2 = {
56782
57004
  key: 1,
56783
57005
  class: "stat"
56784
57006
  };
56785
- _hoisted_45$2 = { class: "stat-label" };
56786
- _hoisted_46$2 = { class: "stat-value" };
56787
- _hoisted_47$2 = { class: "table-actions" };
56788
- _hoisted_48$1 = ["onClick"];
56789
- _hoisted_49$1 = {
57007
+ _hoisted_46$2 = { class: "stat-label" };
57008
+ _hoisted_47$2 = { class: "stat-value" };
57009
+ _hoisted_48$1 = { class: "table-actions" };
57010
+ _hoisted_49$1 = ["onClick"];
57011
+ _hoisted_50$1 = {
56790
57012
  key: 0,
56791
57013
  class: "empty-state"
56792
57014
  };
56793
- _hoisted_50$1 = { class: "tab-panel" };
56794
- _hoisted_51$1 = { class: "views-actions mb-3" };
56795
- _hoisted_52$1 = {
57015
+ _hoisted_51$1 = { class: "tab-panel" };
57016
+ _hoisted_52$1 = { class: "views-actions mb-3" };
57017
+ _hoisted_53$1 = {
56796
57018
  key: 0,
56797
57019
  class: "views-grid"
56798
57020
  };
56799
- _hoisted_53$1 = { class: "card-header" };
56800
- _hoisted_54$1 = { class: "view-info" };
56801
- _hoisted_55$1 = { class: "view-name" };
56802
- _hoisted_56$1 = {
57021
+ _hoisted_54$1 = { class: "card-header" };
57022
+ _hoisted_55$1 = { class: "view-info" };
57023
+ _hoisted_56$1 = { class: "view-name" };
57024
+ _hoisted_57$1 = {
56803
57025
  key: 0,
56804
57026
  class: "view-comment"
56805
57027
  };
56806
- _hoisted_57$1 = { class: "card-body" };
56807
- _hoisted_58$1 = { class: "view-actions" };
56808
- _hoisted_59$1 = ["onClick"];
57028
+ _hoisted_58$1 = { class: "card-body" };
57029
+ _hoisted_59$1 = { class: "view-actions" };
56809
57030
  _hoisted_60$1 = ["onClick"];
56810
- _hoisted_61$1 = {
57031
+ _hoisted_61$1 = ["onClick"];
57032
+ _hoisted_62$1 = {
56811
57033
  key: 1,
56812
57034
  class: "empty-state"
56813
57035
  };
56814
- _hoisted_62$1 = { class: "tab-panel" };
56815
- _hoisted_63$1 = { class: "procedures-actions mb-3" };
56816
- _hoisted_64$1 = {
57036
+ _hoisted_63$1 = { class: "tab-panel" };
57037
+ _hoisted_64$1 = { class: "procedures-actions mb-3" };
57038
+ _hoisted_65$1 = {
56817
57039
  key: 0,
56818
57040
  class: "procedures-grid"
56819
57041
  };
56820
- _hoisted_65$1 = { class: "card-header" };
56821
- _hoisted_66$1 = { class: "procedure-info" };
56822
- _hoisted_67$1 = { class: "procedure-name" };
56823
- _hoisted_68$1 = {
57042
+ _hoisted_66$1 = { class: "card-header" };
57043
+ _hoisted_67$1 = { class: "procedure-info" };
57044
+ _hoisted_68$1 = { class: "procedure-name" };
57045
+ _hoisted_69$1 = {
56824
57046
  key: 0,
56825
57047
  class: "procedure-comment"
56826
57048
  };
56827
- _hoisted_69$1 = { class: "procedure-type" };
56828
- _hoisted_70$1 = { class: "badge bg-info" };
56829
- _hoisted_71$1 = {
57049
+ _hoisted_70$1 = { class: "procedure-type" };
57050
+ _hoisted_71$1 = { class: "badge bg-info" };
57051
+ _hoisted_72$1 = {
56830
57052
  key: 0,
56831
57053
  class: "badge bg-secondary ms-1"
56832
57054
  };
56833
- _hoisted_72$1 = { class: "card-body" };
56834
- _hoisted_73$1 = { class: "procedure-actions" };
56835
- _hoisted_74 = ["onClick"];
57055
+ _hoisted_73$1 = { class: "card-body" };
57056
+ _hoisted_74 = { class: "procedure-actions" };
56836
57057
  _hoisted_75 = ["onClick"];
56837
- _hoisted_76 = {
57058
+ _hoisted_76 = ["onClick"];
57059
+ _hoisted_77 = {
56838
57060
  key: 1,
56839
57061
  class: "empty-state"
56840
57062
  };
56841
- _hoisted_77 = { class: "tab-panel" };
56842
- _hoisted_78 = { class: "empty-state" };
56843
- _hoisted_79 = { class: "tab-panel" };
56844
- _hoisted_80 = { class: "sql-executor-section" };
56845
- _hoisted_81 = { class: "tab-panel" };
56846
- _hoisted_82 = {
57063
+ _hoisted_78 = { class: "tab-panel" };
57064
+ _hoisted_79 = { class: "empty-state" };
57065
+ _hoisted_80 = { class: "tab-panel" };
57066
+ _hoisted_81 = { class: "sql-executor-section" };
57067
+ _hoisted_82 = { class: "tab-panel" };
57068
+ _hoisted_83 = {
56847
57069
  key: 0,
56848
57070
  class: "modal fade show d-block",
56849
57071
  style: { "background": "rgba(0,0,0,0.5)" }
56850
57072
  };
56851
- _hoisted_83 = { class: "modal-dialog modal-lg" };
56852
- _hoisted_84 = { class: "modal-content" };
56853
- _hoisted_85 = { class: "modal-header" };
56854
- _hoisted_86 = { class: "modal-title" };
56855
- _hoisted_87 = { class: "modal-body" };
56856
- _hoisted_88 = { class: "mb-3" };
56857
- _hoisted_89 = { class: "form-label" };
56858
- _hoisted_90 = ["placeholder"];
56859
- _hoisted_91 = { class: "mb-3" };
56860
- _hoisted_92 = { class: "form-label" };
56861
- _hoisted_93 = ["placeholder"];
56862
- _hoisted_94 = { class: "modal-footer" };
56863
- _hoisted_95 = {
57073
+ _hoisted_84 = { class: "modal-dialog modal-lg" };
57074
+ _hoisted_85 = { class: "modal-content" };
57075
+ _hoisted_86 = { class: "modal-header" };
57076
+ _hoisted_87 = { class: "modal-title" };
57077
+ _hoisted_88 = { class: "modal-body" };
57078
+ _hoisted_89 = { class: "mb-3" };
57079
+ _hoisted_90 = { class: "form-label" };
57080
+ _hoisted_91 = ["placeholder"];
57081
+ _hoisted_92 = { class: "mb-3" };
57082
+ _hoisted_93 = { class: "form-label" };
57083
+ _hoisted_94 = ["placeholder"];
57084
+ _hoisted_95 = { class: "modal-footer" };
57085
+ _hoisted_96 = {
56864
57086
  key: 1,
56865
57087
  class: "modal fade show d-block",
56866
57088
  style: { "background": "rgba(0,0,0,0.5)" }
56867
57089
  };
56868
- _hoisted_96 = { class: "modal-dialog modal-lg" };
56869
- _hoisted_97 = { class: "modal-content" };
56870
- _hoisted_98 = { class: "modal-header" };
56871
- _hoisted_99 = { class: "modal-title" };
56872
- _hoisted_100 = { class: "modal-body" };
56873
- _hoisted_101 = { class: "mb-3" };
56874
- _hoisted_102 = { class: "form-label" };
56875
- _hoisted_103 = ["placeholder"];
56876
- _hoisted_104 = { class: "mb-3" };
56877
- _hoisted_105 = { class: "form-label" };
56878
- _hoisted_106 = ["placeholder"];
56879
- _hoisted_107 = { class: "mb-3" };
56880
- _hoisted_108 = { class: "form-label" };
56881
- _hoisted_109 = ["placeholder"];
56882
- _hoisted_110 = { class: "modal-footer" };
56883
- _hoisted_111 = {
57090
+ _hoisted_97 = { class: "modal-dialog modal-lg" };
57091
+ _hoisted_98 = { class: "modal-content" };
57092
+ _hoisted_99 = { class: "modal-header" };
57093
+ _hoisted_100 = { class: "modal-title" };
57094
+ _hoisted_101 = { class: "modal-body" };
57095
+ _hoisted_102 = { class: "mb-3" };
57096
+ _hoisted_103 = { class: "form-label" };
57097
+ _hoisted_104 = ["placeholder"];
57098
+ _hoisted_105 = { class: "mb-3" };
57099
+ _hoisted_106 = { class: "form-label" };
57100
+ _hoisted_107 = ["placeholder"];
57101
+ _hoisted_108 = { class: "mb-3" };
57102
+ _hoisted_109 = { class: "form-label" };
57103
+ _hoisted_110 = ["placeholder"];
57104
+ _hoisted_111 = { class: "modal-footer" };
57105
+ _hoisted_112 = {
56884
57106
  key: 2,
56885
57107
  class: "modal fade show d-block",
56886
57108
  style: { "background": "rgba(0,0,0,0.5)" }
56887
57109
  };
56888
- _hoisted_112 = { class: "modal-dialog modal-lg" };
56889
- _hoisted_113 = { class: "modal-content" };
56890
- _hoisted_114 = { class: "modal-header" };
56891
- _hoisted_115 = { class: "modal-title" };
56892
- _hoisted_116 = { class: "modal-body" };
56893
- _hoisted_117 = { class: "mb-3" };
56894
- _hoisted_118 = { class: "form-label" };
56895
- _hoisted_119 = ["placeholder"];
56896
- _hoisted_120 = { class: "mb-3" };
56897
- _hoisted_121 = { class: "form-label" };
56898
- _hoisted_122 = ["placeholder"];
56899
- _hoisted_123 = { class: "mb-3" };
56900
- _hoisted_124 = { class: "form-label" };
56901
- _hoisted_125 = ["placeholder"];
56902
- _hoisted_126 = { class: "modal-footer" };
57110
+ _hoisted_113 = { class: "modal-dialog modal-lg" };
57111
+ _hoisted_114 = { class: "modal-content" };
57112
+ _hoisted_115 = { class: "modal-header" };
57113
+ _hoisted_116 = { class: "modal-title" };
57114
+ _hoisted_117 = { class: "modal-body" };
57115
+ _hoisted_118 = { class: "mb-3" };
57116
+ _hoisted_119 = { class: "form-label" };
57117
+ _hoisted_120 = ["placeholder"];
57118
+ _hoisted_121 = { class: "mb-3" };
57119
+ _hoisted_122 = { class: "form-label" };
57120
+ _hoisted_123 = ["placeholder"];
57121
+ _hoisted_124 = { class: "mb-3" };
57122
+ _hoisted_125 = { class: "form-label" };
57123
+ _hoisted_126 = ["placeholder"];
57124
+ _hoisted_127 = { class: "modal-footer" };
56903
57125
  database_detail_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
56904
57126
  __name: "database-detail",
56905
57127
  props: {
@@ -56913,7 +57135,8 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56913
57135
  "select-table",
56914
57136
  "refresh-database",
56915
57137
  "create-table",
56916
- "execute-sql"
57138
+ "execute-sql",
57139
+ "navigate-connection"
56917
57140
  ],
56918
57141
  setup(__props, { emit: __emit }) {
56919
57142
  const props = __props;
@@ -56933,7 +57156,8 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56933
57156
  const procedures = ref([]);
56934
57157
  const editingProcedure = ref(null);
56935
57158
  const showTableEditor = ref(false);
56936
- const editingTableName = ref("");
57159
+ const tableEditorMode = ref("create");
57160
+ const editingTable = ref(null);
56937
57161
  const tables = computed(() => {
56938
57162
  return props.tables || [];
56939
57163
  });
@@ -56970,21 +57194,39 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
56970
57194
  }
56971
57195
  function createTable() {
56972
57196
  if (!newTable.value.name.trim()) return;
56973
- editingTableName.value = newTable.value.name;
57197
+ tableEditorMode.value = "create";
57198
+ editingTable.value = {
57199
+ name: newTable.value.name,
57200
+ comment: newTable.value.comment,
57201
+ rowCount: 0,
57202
+ dataSize: 0,
57203
+ indexSize: 0,
57204
+ columns: []
57205
+ };
56974
57206
  showTableEditor.value = true;
56975
57207
  showCreateTable.value = false;
56976
57208
  }
56977
- function editTable(table) {
56978
- editingTableName.value = table.name;
56979
- showTableEditor.value = true;
57209
+ async function editTable(table) {
57210
+ if (!props.connection?.id) return;
57211
+ try {
57212
+ const response = await databaseService.getTableInfo(props.connection.id, props.database, table.name);
57213
+ editingTable.value = response.data || null;
57214
+ tableEditorMode.value = "edit";
57215
+ showTableEditor.value = true;
57216
+ } catch (error) {
57217
+ console.error("获取表结构失败:", error);
57218
+ modal.error(t("databaseDetail.getTableInfoFailed"));
57219
+ }
56980
57220
  }
56981
57221
  function createNewTable() {
56982
- editingTableName.value = "";
57222
+ tableEditorMode.value = "create";
57223
+ editingTable.value = null;
56983
57224
  showTableEditor.value = true;
56984
57225
  }
56985
57226
  function closeTableEditor() {
56986
57227
  showTableEditor.value = false;
56987
- editingTableName.value = "";
57228
+ tableEditorMode.value = "create";
57229
+ editingTable.value = null;
56988
57230
  }
56989
57231
  onMounted(() => {
56990
57232
  if (props.connection?.id && props.database) {
@@ -57159,216 +57401,225 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57159
57401
  }
57160
57402
  return (_ctx, _cache) => {
57161
57403
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
57162
- createBaseVNode("div", _hoisted_2$4, [createBaseVNode("div", _hoisted_3$4, [createBaseVNode("div", _hoisted_4$4, [_cache[19] || (_cache[19] = 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, [createBaseVNode("span", _hoisted_8$4, toDisplayString(__props.connection?.name), 1), createBaseVNode("span", _hoisted_9$4, toDisplayString(getDbTypeLabel(__props.connection?.type)), 1)])])]), createBaseVNode("div", _hoisted_10$4, [createBaseVNode("div", _hoisted_11$4, [createBaseVNode("div", _hoisted_12$4, toDisplayString(__props.databaseInfo?.tableCount || 0), 1), createBaseVNode("div", _hoisted_13$4, toDisplayString(_ctx.$t("connection.tableCount")), 1)]), createBaseVNode("div", _hoisted_14$4, [createBaseVNode("div", _hoisted_15$4, toDisplayString(formatSize(__props.databaseInfo?.size || 0)), 1), createBaseVNode("div", _hoisted_16$4, toDisplayString(_ctx.$t("databaseDetail.size")), 1)])])])]),
57163
- createBaseVNode("div", _hoisted_17$4, [createBaseVNode("ul", _hoisted_18$4, [
57164
- createBaseVNode("li", _hoisted_19$4, [createBaseVNode("button", {
57165
- class: normalizeClass(["nav-link", { active: activeTab.value === "tables" }]),
57166
- onClick: _cache[0] || (_cache[0] = ($event) => activeTab.value = "tables")
57167
- }, [_cache[20] || (_cache[20] = createBaseVNode("i", { class: "bi bi-table" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.tables")), 1)], 2)]),
57404
+ createBaseVNode("div", _hoisted_2$4, [createBaseVNode("div", _hoisted_3$4, [createBaseVNode("div", _hoisted_4$4, [_cache[22] || (_cache[22] = 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, [
57405
+ createBaseVNode("span", {
57406
+ class: "crumb crumb-link",
57407
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("navigate-connection")),
57408
+ title: _ctx.$t("databaseDetail.backToConnection")
57409
+ }, [_cache[20] || (_cache[20] = createBaseVNode("i", { class: "bi bi-hdd-network me-1" }, null, -1)), createTextVNode(toDisplayString(__props.connection?.name), 1)], 8, _hoisted_8$4),
57410
+ _cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
57411
+ createBaseVNode("span", _hoisted_9$4, toDisplayString(__props.database), 1),
57412
+ createBaseVNode("span", _hoisted_10$4, toDisplayString(getDbTypeLabel(__props.connection?.type)), 1)
57413
+ ])])]), createBaseVNode("div", _hoisted_11$4, [createBaseVNode("div", _hoisted_12$4, [createBaseVNode("div", _hoisted_13$4, toDisplayString(__props.databaseInfo?.tableCount || 0), 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)])])])]),
57414
+ createBaseVNode("div", _hoisted_18$4, [createBaseVNode("ul", _hoisted_19$4, [
57168
57415
  createBaseVNode("li", _hoisted_20$4, [createBaseVNode("button", {
57169
- class: normalizeClass(["nav-link", { active: activeTab.value === "views" }]),
57170
- onClick: _cache[1] || (_cache[1] = ($event) => activeTab.value = "views")
57171
- }, [_cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-eye" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.views")), 1)], 2)]),
57416
+ class: normalizeClass(["nav-link", { active: activeTab.value === "tables" }]),
57417
+ onClick: _cache[1] || (_cache[1] = ($event) => activeTab.value = "tables")
57418
+ }, [_cache[23] || (_cache[23] = createBaseVNode("i", { class: "bi bi-table" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.tables")), 1)], 2)]),
57172
57419
  createBaseVNode("li", _hoisted_21$4, [createBaseVNode("button", {
57173
- class: normalizeClass(["nav-link", { active: activeTab.value === "procedures" }]),
57174
- onClick: _cache[2] || (_cache[2] = ($event) => activeTab.value = "procedures")
57175
- }, [_cache[22] || (_cache[22] = createBaseVNode("i", { class: "bi bi-gear" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.procedures")), 1)], 2)]),
57420
+ class: normalizeClass(["nav-link", { active: activeTab.value === "views" }]),
57421
+ onClick: _cache[2] || (_cache[2] = ($event) => activeTab.value = "views")
57422
+ }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-eye" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.views")), 1)], 2)]),
57176
57423
  createBaseVNode("li", _hoisted_22$4, [createBaseVNode("button", {
57177
- class: normalizeClass(["nav-link", { active: activeTab.value === "sql" }]),
57178
- onClick: _cache[3] || (_cache[3] = ($event) => activeTab.value = "sql")
57179
- }, [_cache[23] || (_cache[23] = createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.executeSQL")), 1)], 2)]),
57424
+ class: normalizeClass(["nav-link", { active: activeTab.value === "procedures" }]),
57425
+ onClick: _cache[3] || (_cache[3] = ($event) => activeTab.value = "procedures")
57426
+ }, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-gear" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.procedures")), 1)], 2)]),
57180
57427
  createBaseVNode("li", _hoisted_23$4, [createBaseVNode("button", {
57428
+ class: normalizeClass(["nav-link", { active: activeTab.value === "sql" }]),
57429
+ onClick: _cache[4] || (_cache[4] = ($event) => activeTab.value = "sql")
57430
+ }, [_cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-terminal" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.executeSQL")), 1)], 2)]),
57431
+ createBaseVNode("li", _hoisted_24$4, [createBaseVNode("button", {
57181
57432
  class: normalizeClass(["nav-link", { active: activeTab.value === "tools" }]),
57182
- onClick: _cache[4] || (_cache[4] = ($event) => activeTab.value = "tools")
57183
- }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-tools" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.tools")), 1)], 2)])
57184
- ]), createBaseVNode("div", _hoisted_24$4, [
57185
- withDirectives(createBaseVNode("div", _hoisted_25$3, [createBaseVNode("div", _hoisted_26$3, [createBaseVNode("button", {
57433
+ onClick: _cache[5] || (_cache[5] = ($event) => activeTab.value = "tools")
57434
+ }, [_cache[27] || (_cache[27] = createBaseVNode("i", { class: "bi bi-tools" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.tools")), 1)], 2)])
57435
+ ]), createBaseVNode("div", _hoisted_25$4, [
57436
+ withDirectives(createBaseVNode("div", _hoisted_26$3, [createBaseVNode("div", _hoisted_27$3, [createBaseVNode("button", {
57186
57437
  class: "btn btn-primary btn-sm",
57187
57438
  onClick: createNewTable
57188
- }, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createTable")), 1)]), createBaseVNode("button", {
57439
+ }, [_cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createTable")), 1)]), createBaseVNode("button", {
57189
57440
  class: "btn btn-outline-secondary btn-sm",
57190
57441
  onClick: handleRefreshDatabase
57191
- }, [_cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), __props.loading ? (openBlock(), createElementBlock("div", _hoisted_27$3, [createBaseVNode("div", _hoisted_28$3, [createBaseVNode("span", _hoisted_29$3, toDisplayString(_ctx.$t("common.loading")), 1)]), createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.loadingTables")), 1)])) : (openBlock(), createElementBlock("div", _hoisted_30$2, [createBaseVNode("div", _hoisted_31$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(tables.value, (table) => {
57442
+ }, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), __props.loading ? (openBlock(), createElementBlock("div", _hoisted_28$3, [createBaseVNode("div", _hoisted_29$3, [createBaseVNode("span", _hoisted_30$2, toDisplayString(_ctx.$t("common.loading")), 1)]), createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.loadingTables")), 1)])) : (openBlock(), createElementBlock("div", _hoisted_31$2, [createBaseVNode("div", _hoisted_32$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(tables.value, (table) => {
57192
57443
  return openBlock(), createElementBlock("div", {
57193
57444
  key: table.name,
57194
57445
  class: "table-card",
57195
57446
  onClick: ($event) => selectTable(table)
57196
- }, [createBaseVNode("div", _hoisted_33$2, [_cache[27] || (_cache[27] = createBaseVNode("div", { class: "table-icon" }, [createBaseVNode("i", { class: "bi bi-table" })], -1)), createBaseVNode("div", _hoisted_34$2, [createBaseVNode("div", _hoisted_35$2, [createBaseVNode("div", {
57447
+ }, [createBaseVNode("div", _hoisted_34$2, [_cache[30] || (_cache[30] = createBaseVNode("div", { class: "table-icon" }, [createBaseVNode("i", { class: "bi bi-table" })], -1)), createBaseVNode("div", _hoisted_35$2, [createBaseVNode("div", _hoisted_36$2, [createBaseVNode("div", {
57197
57448
  class: "table-name",
57198
57449
  title: table.name
57199
- }, toDisplayString(table.name), 9, _hoisted_36$2), createBaseVNode("div", _hoisted_37$2, toDisplayString(table.engine || "-"), 1)]), table.comment ? (openBlock(), createElementBlock("div", {
57450
+ }, toDisplayString(table.name), 9, _hoisted_37$2), createBaseVNode("div", _hoisted_38$2, toDisplayString(table.engine || "-"), 1)]), table.comment ? (openBlock(), createElementBlock("div", {
57200
57451
  key: 0,
57201
57452
  class: "table-comment-header",
57202
57453
  title: table.comment
57203
- }, toDisplayString(table.comment), 9, _hoisted_38$2)) : createCommentVNode("", true)])]), createBaseVNode("div", _hoisted_39$2, [createBaseVNode("div", _hoisted_40$2, [table.rowCount !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_41$2, [createBaseVNode("span", _hoisted_42$2, toDisplayString(_ctx.$t("databaseDetail.rowCountLabel")), 1), createBaseVNode("span", _hoisted_43$2, toDisplayString(formatNumber(table.rowCount)), 1)])) : createCommentVNode("", true), table.dataSize !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_44$2, [createBaseVNode("span", _hoisted_45$2, toDisplayString(_ctx.$t("databaseDetail.size")), 1), createBaseVNode("span", _hoisted_46$2, toDisplayString(formatSize(table.dataSize)), 1)])) : createCommentVNode("", true)]), createBaseVNode("div", _hoisted_47$2, [createBaseVNode("button", {
57454
+ }, toDisplayString(table.comment), 9, _hoisted_39$2)) : createCommentVNode("", true)])]), createBaseVNode("div", _hoisted_40$2, [createBaseVNode("div", _hoisted_41$2, [table.rowCount !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_42$2, [createBaseVNode("span", _hoisted_43$2, toDisplayString(_ctx.$t("databaseDetail.rowCountLabel")), 1), createBaseVNode("span", _hoisted_44$2, toDisplayString(formatNumber(table.rowCount)), 1)])) : createCommentVNode("", true), table.dataSize !== void 0 ? (openBlock(), createElementBlock("div", _hoisted_45$2, [createBaseVNode("span", _hoisted_46$2, toDisplayString(_ctx.$t("databaseDetail.size")), 1), createBaseVNode("span", _hoisted_47$2, toDisplayString(formatSize(table.dataSize)), 1)])) : createCommentVNode("", true)]), createBaseVNode("div", _hoisted_48$1, [createBaseVNode("button", {
57204
57455
  class: "btn btn-sm btn-outline-primary",
57205
57456
  onClick: withModifiers(($event) => editTable(table), ["stop"])
57206
- }, [..._cache[28] || (_cache[28] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_48$1)])])], 8, _hoisted_32$2);
57207
- }), 128))]), !tables.value || tables.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_49$1, [
57208
- _cache[30] || (_cache[30] = createBaseVNode("i", { class: "bi bi-inbox" }, null, -1)),
57457
+ }, [..._cache[31] || (_cache[31] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_49$1)])])], 8, _hoisted_33$2);
57458
+ }), 128))]), !tables.value || tables.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_50$1, [
57459
+ _cache[33] || (_cache[33] = createBaseVNode("i", { class: "bi bi-inbox" }, null, -1)),
57209
57460
  createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.noTable")), 1),
57210
57461
  createBaseVNode("button", {
57211
57462
  class: "btn btn-primary",
57212
57463
  onClick: createNewTable
57213
- }, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createTable")), 1)])
57464
+ }, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createTable")), 1)])
57214
57465
  ])) : createCommentVNode("", true)]))], 512), [[vShow, activeTab.value === "tables"]]),
57215
- withDirectives(createBaseVNode("div", _hoisted_50$1, [createBaseVNode("div", _hoisted_51$1, [createBaseVNode("button", {
57466
+ withDirectives(createBaseVNode("div", _hoisted_51$1, [createBaseVNode("div", _hoisted_52$1, [createBaseVNode("button", {
57216
57467
  class: "btn btn-success btn-sm",
57217
57468
  onClick: showCreateViewModal
57218
- }, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createView")), 1)]), createBaseVNode("button", {
57469
+ }, [_cache[34] || (_cache[34] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createView")), 1)]), createBaseVNode("button", {
57219
57470
  class: "btn btn-info btn-sm",
57220
57471
  onClick: refreshViews
57221
- }, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), views.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_52$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(views.value, (view) => {
57472
+ }, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), views.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_53$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(views.value, (view) => {
57222
57473
  return openBlock(), createElementBlock("div", {
57223
57474
  key: view.name,
57224
57475
  class: "view-card"
57225
- }, [createBaseVNode("div", _hoisted_53$1, [_cache[33] || (_cache[33] = createBaseVNode("div", { class: "view-icon" }, [createBaseVNode("i", { class: "bi bi-eye" })], -1)), createBaseVNode("div", _hoisted_54$1, [createBaseVNode("div", _hoisted_55$1, toDisplayString(view.name), 1), view.comment ? (openBlock(), createElementBlock("div", _hoisted_56$1, toDisplayString(view.comment), 1)) : createCommentVNode("", true)])]), createBaseVNode("div", _hoisted_57$1, [createBaseVNode("div", _hoisted_58$1, [createBaseVNode("button", {
57476
+ }, [createBaseVNode("div", _hoisted_54$1, [_cache[36] || (_cache[36] = createBaseVNode("div", { class: "view-icon" }, [createBaseVNode("i", { class: "bi bi-eye" })], -1)), createBaseVNode("div", _hoisted_55$1, [createBaseVNode("div", _hoisted_56$1, toDisplayString(view.name), 1), view.comment ? (openBlock(), createElementBlock("div", _hoisted_57$1, toDisplayString(view.comment), 1)) : createCommentVNode("", true)])]), createBaseVNode("div", _hoisted_58$1, [createBaseVNode("div", _hoisted_59$1, [createBaseVNode("button", {
57226
57477
  class: "btn btn-sm btn-outline-primary",
57227
57478
  onClick: ($event) => editView(view)
57228
- }, [_cache[34] || (_cache[34] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)], 8, _hoisted_59$1), createBaseVNode("button", {
57479
+ }, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)], 8, _hoisted_60$1), createBaseVNode("button", {
57229
57480
  class: "btn btn-sm btn-outline-danger",
57230
57481
  onClick: ($event) => deleteView(view)
57231
- }, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.delete")), 1)], 8, _hoisted_60$1)])])]);
57232
- }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_61$1, [
57233
- _cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-eye" }, null, -1)),
57482
+ }, [_cache[38] || (_cache[38] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.delete")), 1)], 8, _hoisted_61$1)])])]);
57483
+ }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_62$1, [
57484
+ _cache[40] || (_cache[40] = createBaseVNode("i", { class: "bi bi-eye" }, null, -1)),
57234
57485
  createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.noView")), 1),
57235
57486
  createBaseVNode("button", {
57236
57487
  class: "btn btn-success",
57237
57488
  onClick: showCreateViewModal
57238
- }, [_cache[36] || (_cache[36] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createView")), 1)])
57489
+ }, [_cache[39] || (_cache[39] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createView")), 1)])
57239
57490
  ]))], 512), [[vShow, activeTab.value === "views"]]),
57240
- withDirectives(createBaseVNode("div", _hoisted_62$1, [createBaseVNode("div", _hoisted_63$1, [createBaseVNode("button", {
57491
+ withDirectives(createBaseVNode("div", _hoisted_63$1, [createBaseVNode("div", _hoisted_64$1, [createBaseVNode("button", {
57241
57492
  class: "btn btn-info btn-sm",
57242
57493
  onClick: showCreateProcedureModal
57243
- }, [_cache[38] || (_cache[38] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createProcedure")), 1)]), createBaseVNode("button", {
57494
+ }, [_cache[41] || (_cache[41] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createProcedure")), 1)]), createBaseVNode("button", {
57244
57495
  class: "btn btn-info btn-sm",
57245
57496
  onClick: refreshProcedures
57246
- }, [_cache[39] || (_cache[39] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), procedures.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_64$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(procedures.value, (procedure) => {
57497
+ }, [_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.refresh")), 1)])]), procedures.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_65$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(procedures.value, (procedure) => {
57247
57498
  return openBlock(), createElementBlock("div", {
57248
57499
  key: procedure.name,
57249
57500
  class: "procedure-card"
57250
- }, [createBaseVNode("div", _hoisted_65$1, [_cache[40] || (_cache[40] = createBaseVNode("div", { class: "procedure-icon" }, [createBaseVNode("i", { class: "bi bi-gear" })], -1)), createBaseVNode("div", _hoisted_66$1, [
57251
- createBaseVNode("div", _hoisted_67$1, toDisplayString(procedure.name), 1),
57252
- procedure.comment ? (openBlock(), createElementBlock("div", _hoisted_68$1, toDisplayString(procedure.comment), 1)) : createCommentVNode("", true),
57253
- createBaseVNode("div", _hoisted_69$1, [createBaseVNode("span", _hoisted_70$1, toDisplayString(procedure.type), 1), procedure.returnType ? (openBlock(), createElementBlock("span", _hoisted_71$1, toDisplayString(procedure.returnType), 1)) : createCommentVNode("", true)])
57254
- ])]), createBaseVNode("div", _hoisted_72$1, [createBaseVNode("div", _hoisted_73$1, [createBaseVNode("button", {
57501
+ }, [createBaseVNode("div", _hoisted_66$1, [_cache[43] || (_cache[43] = createBaseVNode("div", { class: "procedure-icon" }, [createBaseVNode("i", { class: "bi bi-gear" })], -1)), createBaseVNode("div", _hoisted_67$1, [
57502
+ createBaseVNode("div", _hoisted_68$1, toDisplayString(procedure.name), 1),
57503
+ procedure.comment ? (openBlock(), createElementBlock("div", _hoisted_69$1, toDisplayString(procedure.comment), 1)) : createCommentVNode("", true),
57504
+ createBaseVNode("div", _hoisted_70$1, [createBaseVNode("span", _hoisted_71$1, toDisplayString(procedure.type), 1), procedure.returnType ? (openBlock(), createElementBlock("span", _hoisted_72$1, toDisplayString(procedure.returnType), 1)) : createCommentVNode("", true)])
57505
+ ])]), createBaseVNode("div", _hoisted_73$1, [createBaseVNode("div", _hoisted_74, [createBaseVNode("button", {
57255
57506
  class: "btn btn-sm btn-outline-primary",
57256
57507
  onClick: ($event) => editProcedure(procedure)
57257
- }, [_cache[41] || (_cache[41] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)], 8, _hoisted_74), createBaseVNode("button", {
57508
+ }, [_cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.edit")), 1)], 8, _hoisted_75), createBaseVNode("button", {
57258
57509
  class: "btn btn-sm btn-outline-danger",
57259
57510
  onClick: ($event) => deleteProcedure(procedure)
57260
- }, [_cache[42] || (_cache[42] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.delete")), 1)], 8, _hoisted_75)])])]);
57261
- }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_76, [
57262
- _cache[44] || (_cache[44] = createBaseVNode("i", { class: "bi bi-gear" }, null, -1)),
57511
+ }, [_cache[45] || (_cache[45] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("common.delete")), 1)], 8, _hoisted_76)])])]);
57512
+ }), 128))])) : (openBlock(), createElementBlock("div", _hoisted_77, [
57513
+ _cache[47] || (_cache[47] = createBaseVNode("i", { class: "bi bi-gear" }, null, -1)),
57263
57514
  createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.noProcedure")), 1),
57264
57515
  createBaseVNode("button", {
57265
57516
  class: "btn btn-info",
57266
57517
  onClick: showCreateProcedureModal
57267
- }, [_cache[43] || (_cache[43] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createProcedure")), 1)])
57518
+ }, [_cache[46] || (_cache[46] = createBaseVNode("i", { class: "bi bi-plus" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("databaseDetail.createProcedure")), 1)])
57268
57519
  ]))], 512), [[vShow, activeTab.value === "procedures"]]),
57269
- withDirectives(createBaseVNode("div", _hoisted_77, [createBaseVNode("div", _hoisted_78, [_cache[45] || (_cache[45] = createBaseVNode("i", { class: "bi bi-code-slash" }, null, -1)), createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.functionInDev")), 1)])], 512), [[vShow, activeTab.value === "functions"]]),
57270
- withDirectives(createBaseVNode("div", _hoisted_79, [createBaseVNode("div", _hoisted_80, [createVNode(sql_executor_default, {
57520
+ withDirectives(createBaseVNode("div", _hoisted_78, [createBaseVNode("div", _hoisted_79, [_cache[48] || (_cache[48] = createBaseVNode("i", { class: "bi bi-code-slash" }, null, -1)), createBaseVNode("p", null, toDisplayString(_ctx.$t("databaseDetail.functionInDev")), 1)])], 512), [[vShow, activeTab.value === "functions"]]),
57521
+ withDirectives(createBaseVNode("div", _hoisted_80, [createBaseVNode("div", _hoisted_81, [createVNode(sql_executor_default, {
57271
57522
  connection: __props.connection,
57272
57523
  database: __props.database
57273
57524
  }, null, 8, ["connection", "database"])])], 512), [[vShow, activeTab.value === "sql"]]),
57274
- withDirectives(createBaseVNode("div", _hoisted_81, [createVNode(db_tools_default, {
57525
+ withDirectives(createBaseVNode("div", _hoisted_82, [createVNode(db_tools_default, {
57275
57526
  connection: __props.connection,
57276
57527
  database: __props.database,
57277
57528
  onExecuteSql: handleExecuteSQL
57278
57529
  }, null, 8, ["connection", "database"])], 512), [[vShow, activeTab.value === "tools"]])
57279
57530
  ])]),
57280
- showCreateTable.value ? (openBlock(), createElementBlock("div", _hoisted_82, [createBaseVNode("div", _hoisted_83, [createBaseVNode("div", _hoisted_84, [
57281
- createBaseVNode("div", _hoisted_85, [createBaseVNode("h5", _hoisted_86, toDisplayString(_ctx.$t("databaseDetail.createTableTitle")), 1), createBaseVNode("button", {
57531
+ showCreateTable.value ? (openBlock(), createElementBlock("div", _hoisted_83, [createBaseVNode("div", _hoisted_84, [createBaseVNode("div", _hoisted_85, [
57532
+ createBaseVNode("div", _hoisted_86, [createBaseVNode("h5", _hoisted_87, toDisplayString(_ctx.$t("databaseDetail.createTableTitle")), 1), createBaseVNode("button", {
57282
57533
  type: "button",
57283
57534
  class: "btn-close",
57284
- onClick: _cache[5] || (_cache[5] = ($event) => showCreateTable.value = false)
57535
+ onClick: _cache[6] || (_cache[6] = ($event) => showCreateTable.value = false)
57285
57536
  })]),
57286
- createBaseVNode("div", _hoisted_87, [createBaseVNode("form", null, [createBaseVNode("div", _hoisted_88, [createBaseVNode("label", _hoisted_89, toDisplayString(_ctx.$t("databaseDetail.tableNameLabel")), 1), withDirectives(createBaseVNode("input", {
57537
+ createBaseVNode("div", _hoisted_88, [createBaseVNode("form", null, [createBaseVNode("div", _hoisted_89, [createBaseVNode("label", _hoisted_90, toDisplayString(_ctx.$t("databaseDetail.tableNameLabel")), 1), withDirectives(createBaseVNode("input", {
57287
57538
  type: "text",
57288
57539
  class: "form-control",
57289
- "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => newTable.value.name = $event),
57540
+ "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => newTable.value.name = $event),
57290
57541
  placeholder: _ctx.$t("databaseDetail.enterTableName")
57291
- }, null, 8, _hoisted_90), [[vModelText, newTable.value.name]])]), createBaseVNode("div", _hoisted_91, [createBaseVNode("label", _hoisted_92, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("textarea", {
57542
+ }, null, 8, _hoisted_91), [[vModelText, newTable.value.name]])]), createBaseVNode("div", _hoisted_92, [createBaseVNode("label", _hoisted_93, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("textarea", {
57292
57543
  class: "form-control",
57293
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => newTable.value.comment = $event),
57544
+ "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => newTable.value.comment = $event),
57294
57545
  placeholder: _ctx.$t("databaseDetail.enterTableComment")
57295
- }, null, 8, _hoisted_93), [[vModelText, newTable.value.comment]])])])]),
57296
- createBaseVNode("div", _hoisted_94, [createBaseVNode("button", {
57546
+ }, null, 8, _hoisted_94), [[vModelText, newTable.value.comment]])])])]),
57547
+ createBaseVNode("div", _hoisted_95, [createBaseVNode("button", {
57297
57548
  type: "button",
57298
57549
  class: "btn btn-secondary",
57299
- onClick: _cache[8] || (_cache[8] = ($event) => showCreateTable.value = false)
57550
+ onClick: _cache[9] || (_cache[9] = ($event) => showCreateTable.value = false)
57300
57551
  }, toDisplayString(_ctx.$t("common.cancel")), 1), createBaseVNode("button", {
57301
57552
  type: "button",
57302
57553
  class: "btn btn-primary",
57303
57554
  onClick: createTable
57304
57555
  }, toDisplayString(_ctx.$t("common.create")), 1)])
57305
57556
  ])])])) : createCommentVNode("", true),
57306
- showCreateView.value && editingView.value ? (openBlock(), createElementBlock("div", _hoisted_95, [createBaseVNode("div", _hoisted_96, [createBaseVNode("div", _hoisted_97, [
57307
- createBaseVNode("div", _hoisted_98, [createBaseVNode("h5", _hoisted_99, toDisplayString(views.value.some((v) => v.name === editingView.value.name) ? _ctx.$t("databaseDetail.editView") : _ctx.$t("databaseDetail.createViewTitle")), 1), createBaseVNode("button", {
57557
+ showCreateView.value && editingView.value ? (openBlock(), createElementBlock("div", _hoisted_96, [createBaseVNode("div", _hoisted_97, [createBaseVNode("div", _hoisted_98, [
57558
+ createBaseVNode("div", _hoisted_99, [createBaseVNode("h5", _hoisted_100, toDisplayString(views.value.some((v) => v.name === editingView.value.name) ? _ctx.$t("databaseDetail.editView") : _ctx.$t("databaseDetail.createViewTitle")), 1), createBaseVNode("button", {
57308
57559
  type: "button",
57309
57560
  class: "btn-close",
57310
- onClick: _cache[9] || (_cache[9] = ($event) => showCreateView.value = false)
57561
+ onClick: _cache[10] || (_cache[10] = ($event) => showCreateView.value = false)
57311
57562
  })]),
57312
- createBaseVNode("div", _hoisted_100, [createBaseVNode("form", null, [
57313
- createBaseVNode("div", _hoisted_101, [createBaseVNode("label", _hoisted_102, toDisplayString(_ctx.$t("databaseDetail.viewNameLabel")), 1), withDirectives(createBaseVNode("input", {
57563
+ createBaseVNode("div", _hoisted_101, [createBaseVNode("form", null, [
57564
+ createBaseVNode("div", _hoisted_102, [createBaseVNode("label", _hoisted_103, toDisplayString(_ctx.$t("databaseDetail.viewNameLabel")), 1), withDirectives(createBaseVNode("input", {
57314
57565
  type: "text",
57315
57566
  class: "form-control",
57316
- "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => editingView.value.name = $event),
57567
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => editingView.value.name = $event),
57317
57568
  placeholder: _ctx.$t("databaseDetail.enterViewName")
57318
- }, null, 8, _hoisted_103), [[vModelText, editingView.value.name]])]),
57319
- createBaseVNode("div", _hoisted_104, [createBaseVNode("label", _hoisted_105, toDisplayString(_ctx.$t("databaseDetail.viewDefinition")), 1), withDirectives(createBaseVNode("textarea", {
57569
+ }, null, 8, _hoisted_104), [[vModelText, editingView.value.name]])]),
57570
+ createBaseVNode("div", _hoisted_105, [createBaseVNode("label", _hoisted_106, toDisplayString(_ctx.$t("databaseDetail.viewDefinition")), 1), withDirectives(createBaseVNode("textarea", {
57320
57571
  class: "form-control",
57321
57572
  rows: "8",
57322
- "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => editingView.value.definition = $event),
57573
+ "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => editingView.value.definition = $event),
57323
57574
  placeholder: _ctx.$t("databaseDetail.viewDefinitionPlaceholder")
57324
- }, null, 8, _hoisted_106), [[vModelText, editingView.value.definition]])]),
57325
- createBaseVNode("div", _hoisted_107, [createBaseVNode("label", _hoisted_108, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("input", {
57575
+ }, null, 8, _hoisted_107), [[vModelText, editingView.value.definition]])]),
57576
+ createBaseVNode("div", _hoisted_108, [createBaseVNode("label", _hoisted_109, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("input", {
57326
57577
  type: "text",
57327
57578
  class: "form-control",
57328
- "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => editingView.value.comment = $event),
57579
+ "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => editingView.value.comment = $event),
57329
57580
  placeholder: _ctx.$t("databaseDetail.enterTableComment")
57330
- }, null, 8, _hoisted_109), [[vModelText, editingView.value.comment]])])
57581
+ }, null, 8, _hoisted_110), [[vModelText, editingView.value.comment]])])
57331
57582
  ])]),
57332
- createBaseVNode("div", _hoisted_110, [createBaseVNode("button", {
57583
+ createBaseVNode("div", _hoisted_111, [createBaseVNode("button", {
57333
57584
  type: "button",
57334
57585
  class: "btn btn-secondary",
57335
- onClick: _cache[13] || (_cache[13] = ($event) => showCreateView.value = false)
57586
+ onClick: _cache[14] || (_cache[14] = ($event) => showCreateView.value = false)
57336
57587
  }, toDisplayString(_ctx.$t("common.cancel")), 1), createBaseVNode("button", {
57337
57588
  type: "button",
57338
57589
  class: "btn btn-primary",
57339
57590
  onClick: createOrUpdateView
57340
57591
  }, toDisplayString(_ctx.$t("common.save")), 1)])
57341
57592
  ])])])) : createCommentVNode("", true),
57342
- showCreateProcedure.value && editingProcedure.value ? (openBlock(), createElementBlock("div", _hoisted_111, [createBaseVNode("div", _hoisted_112, [createBaseVNode("div", _hoisted_113, [
57343
- createBaseVNode("div", _hoisted_114, [createBaseVNode("h5", _hoisted_115, toDisplayString(procedures.value.some((p) => p.name === editingProcedure.value.name) ? _ctx.$t("databaseDetail.editProcedure") : _ctx.$t("databaseDetail.createProcedureTitle")), 1), createBaseVNode("button", {
57593
+ showCreateProcedure.value && editingProcedure.value ? (openBlock(), createElementBlock("div", _hoisted_112, [createBaseVNode("div", _hoisted_113, [createBaseVNode("div", _hoisted_114, [
57594
+ createBaseVNode("div", _hoisted_115, [createBaseVNode("h5", _hoisted_116, toDisplayString(procedures.value.some((p) => p.name === editingProcedure.value.name) ? _ctx.$t("databaseDetail.editProcedure") : _ctx.$t("databaseDetail.createProcedureTitle")), 1), createBaseVNode("button", {
57344
57595
  type: "button",
57345
57596
  class: "btn-close",
57346
- onClick: _cache[14] || (_cache[14] = ($event) => showCreateProcedure.value = false)
57597
+ onClick: _cache[15] || (_cache[15] = ($event) => showCreateProcedure.value = false)
57347
57598
  })]),
57348
- createBaseVNode("div", _hoisted_116, [createBaseVNode("form", null, [
57349
- createBaseVNode("div", _hoisted_117, [createBaseVNode("label", _hoisted_118, toDisplayString(_ctx.$t("databaseDetail.procedureNameLabel")), 1), withDirectives(createBaseVNode("input", {
57599
+ createBaseVNode("div", _hoisted_117, [createBaseVNode("form", null, [
57600
+ createBaseVNode("div", _hoisted_118, [createBaseVNode("label", _hoisted_119, toDisplayString(_ctx.$t("databaseDetail.procedureNameLabel")), 1), withDirectives(createBaseVNode("input", {
57350
57601
  type: "text",
57351
57602
  class: "form-control",
57352
- "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => editingProcedure.value.name = $event),
57603
+ "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => editingProcedure.value.name = $event),
57353
57604
  placeholder: _ctx.$t("databaseDetail.enterProcedureName")
57354
- }, null, 8, _hoisted_119), [[vModelText, editingProcedure.value.name]])]),
57355
- createBaseVNode("div", _hoisted_120, [createBaseVNode("label", _hoisted_121, toDisplayString(_ctx.$t("databaseDetail.procedureDefinition")), 1), withDirectives(createBaseVNode("textarea", {
57605
+ }, null, 8, _hoisted_120), [[vModelText, editingProcedure.value.name]])]),
57606
+ createBaseVNode("div", _hoisted_121, [createBaseVNode("label", _hoisted_122, toDisplayString(_ctx.$t("databaseDetail.procedureDefinition")), 1), withDirectives(createBaseVNode("textarea", {
57356
57607
  class: "form-control",
57357
57608
  rows: "12",
57358
- "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => editingProcedure.value.definition = $event),
57609
+ "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => editingProcedure.value.definition = $event),
57359
57610
  placeholder: _ctx.$t("databaseDetail.procedureDefPlaceholder")
57360
- }, null, 8, _hoisted_122), [[vModelText, editingProcedure.value.definition]])]),
57361
- createBaseVNode("div", _hoisted_123, [createBaseVNode("label", _hoisted_124, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("input", {
57611
+ }, null, 8, _hoisted_123), [[vModelText, editingProcedure.value.definition]])]),
57612
+ createBaseVNode("div", _hoisted_124, [createBaseVNode("label", _hoisted_125, toDisplayString(_ctx.$t("databaseDetail.commentLabel")), 1), withDirectives(createBaseVNode("input", {
57362
57613
  type: "text",
57363
57614
  class: "form-control",
57364
- "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => editingProcedure.value.comment = $event),
57615
+ "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => editingProcedure.value.comment = $event),
57365
57616
  placeholder: _ctx.$t("databaseDetail.enterTableComment")
57366
- }, null, 8, _hoisted_125), [[vModelText, editingProcedure.value.comment]])])
57617
+ }, null, 8, _hoisted_126), [[vModelText, editingProcedure.value.comment]])])
57367
57618
  ])]),
57368
- createBaseVNode("div", _hoisted_126, [createBaseVNode("button", {
57619
+ createBaseVNode("div", _hoisted_127, [createBaseVNode("button", {
57369
57620
  type: "button",
57370
57621
  class: "btn btn-secondary",
57371
- onClick: _cache[18] || (_cache[18] = ($event) => showCreateProcedure.value = false)
57622
+ onClick: _cache[19] || (_cache[19] = ($event) => showCreateProcedure.value = false)
57372
57623
  }, toDisplayString(_ctx.$t("common.cancel")), 1), createBaseVNode("button", {
57373
57624
  type: "button",
57374
57625
  class: "btn btn-primary",
@@ -57379,8 +57630,8 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57379
57630
  visible: showTableEditor.value,
57380
57631
  connection: __props.connection,
57381
57632
  database: __props.database,
57382
- "table-name": editingTableName.value,
57383
- mode: editingTableName.value ? "edit" : "create",
57633
+ table: editingTable.value,
57634
+ mode: tableEditorMode.value,
57384
57635
  onClose: closeTableEditor,
57385
57636
  onSubmit: handleTableChange,
57386
57637
  onExecuteSql: handleExecuteSQL
@@ -57388,7 +57639,7 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57388
57639
  "visible",
57389
57640
  "connection",
57390
57641
  "database",
57391
- "table-name",
57642
+ "table",
57392
57643
  "mode"
57393
57644
  ])
57394
57645
  ]);
@@ -57397,21 +57648,21 @@ var init_database_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57397
57648
  });
57398
57649
  }));
57399
57650
  //#endregion
57400
- //#region src/platform/database/components/database-detail.vue?vue&type=style&index=0&scoped=922ad53c&lang.css
57401
- var init_database_detail_vue_vue_type_style_index_0_scoped_922ad53c_lang = __esmMin((() => {}));
57651
+ //#region src/platform/database/components/database-detail.vue?vue&type=style&index=0&scoped=a6f90f39&lang.css
57652
+ var init_database_detail_vue_vue_type_style_index_0_scoped_a6f90f39_lang = __esmMin((() => {}));
57402
57653
  //#endregion
57403
57654
  //#region src/platform/database/components/database-detail.vue
57404
57655
  var database_detail_default;
57405
57656
  var init_database_detail = __esmMin((() => {
57406
57657
  init_database_detail_vue_vue_type_script_setup_true_lang();
57407
57658
  init_database_detail_vue_vue_type_script_setup_true_lang();
57408
- init_database_detail_vue_vue_type_style_index_0_scoped_922ad53c_lang();
57659
+ init_database_detail_vue_vue_type_style_index_0_scoped_a6f90f39_lang();
57409
57660
  init__plugin_vue_export_helper();
57410
- database_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(database_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-922ad53c"]]);
57661
+ database_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(database_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a6f90f39"]]);
57411
57662
  }));
57412
57663
  //#endregion
57413
57664
  //#region src/platform/database/components/data-editor.vue?vue&type=script&setup=true&lang.ts
57414
- 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$2, _hoisted_26$2, _hoisted_27$2, _hoisted_28$2, _hoisted_29$2, data_editor_vue_vue_type_script_setup_true_lang_default;
57665
+ 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;
57415
57666
  var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57416
57667
  init_vue_runtime_esm_bundler();
57417
57668
  init_vue_i18n();
@@ -57471,7 +57722,7 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57471
57722
  class: "json-editor"
57472
57723
  };
57473
57724
  _hoisted_24$3 = { class: "d-flex justify-content-between mt-1" };
57474
- _hoisted_25$2 = ["onClick"];
57725
+ _hoisted_25$3 = ["onClick"];
57475
57726
  _hoisted_26$2 = [
57476
57727
  "onUpdate:modelValue",
57477
57728
  "placeholder",
@@ -57546,20 +57797,20 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57546
57797
  height: "100%",
57547
57798
  fontSize: "14px",
57548
57799
  fontFamily: "Monaco, Menlo, Consolas, \"Courier New\", monospace",
57549
- backgroundColor: "#f8f9fa"
57800
+ backgroundColor: "var(--db-bg-soft2)"
57550
57801
  },
57551
57802
  ".cm-content": {
57552
57803
  padding: "10px",
57553
57804
  minHeight: "100%",
57554
- backgroundColor: "#ffffff"
57805
+ backgroundColor: "var(--db-surface)"
57555
57806
  },
57556
57807
  ".cm-gutters": {
57557
- backgroundColor: "#f8f9fa",
57558
- color: "#6c757d",
57559
- borderRight: "1px solid #dee2e6"
57808
+ backgroundColor: "var(--db-bg-soft2)",
57809
+ color: "var(--db-text-muted)",
57810
+ borderRight: "1px solid var(--db-border-lighter)"
57560
57811
  },
57561
- ".cm-activeLineGutter": { backgroundColor: "#e9ecef" },
57562
- ".cm-activeLine": { backgroundColor: "#e9ecef" }
57812
+ ".cm-activeLineGutter": { backgroundColor: "var(--db-border-soft)" },
57813
+ ".cm-activeLine": { backgroundColor: "var(--db-border-soft)" }
57563
57814
  })
57564
57815
  ]
57565
57816
  }),
@@ -57820,7 +58071,7 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57820
58071
  ref_for: true,
57821
58072
  ref: (el) => setJsonEditorRef(el, column.name),
57822
58073
  style: {
57823
- "border": "1px solid #dee2e6",
58074
+ "border": "1px solid var(--db-border-lighter)",
57824
58075
  "border-radius": "0.375rem",
57825
58076
  "overflow": "hidden",
57826
58077
  "height": "200px"
@@ -57829,7 +58080,7 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57829
58080
  type: "button",
57830
58081
  class: "btn btn-sm btn-outline-primary",
57831
58082
  onClick: ($event) => formatJson(column.name)
57832
- }, toDisplayString(_ctx.$t("common.format")), 9, _hoisted_25$2)])])) : withDirectives((openBlock(), createElementBlock("input", {
58083
+ }, toDisplayString(_ctx.$t("common.format")), 9, _hoisted_25$3)])])) : withDirectives((openBlock(), createElementBlock("input", {
57833
58084
  key: 7,
57834
58085
  type: "text",
57835
58086
  "data-type": "normal",
@@ -57855,24 +58106,25 @@ var init_data_editor_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57855
58106
  });
57856
58107
  }));
57857
58108
  //#endregion
57858
- //#region src/platform/database/components/data-editor.vue?vue&type=style&index=0&scoped=7f0c01ca&lang.css
57859
- var init_data_editor_vue_vue_type_style_index_0_scoped_7f0c01ca_lang = __esmMin((() => {}));
58109
+ //#region src/platform/database/components/data-editor.vue?vue&type=style&index=0&scoped=d9b3ed26&lang.css
58110
+ var init_data_editor_vue_vue_type_style_index_0_scoped_d9b3ed26_lang = __esmMin((() => {}));
57860
58111
  //#endregion
57861
58112
  //#region src/platform/database/components/data-editor.vue
57862
58113
  var data_editor_default;
57863
58114
  var init_data_editor = __esmMin((() => {
57864
58115
  init_data_editor_vue_vue_type_script_setup_true_lang();
57865
58116
  init_data_editor_vue_vue_type_script_setup_true_lang();
57866
- init_data_editor_vue_vue_type_style_index_0_scoped_7f0c01ca_lang();
58117
+ init_data_editor_vue_vue_type_style_index_0_scoped_d9b3ed26_lang();
57867
58118
  init__plugin_vue_export_helper();
57868
- data_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(data_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7f0c01ca"]]);
58119
+ data_editor_default = /*#__PURE__*/ _plugin_vue_export_helper_default(data_editor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-d9b3ed26"]]);
57869
58120
  }));
57870
58121
  //#endregion
57871
58122
  //#region src/platform/database/components/table-data-grid.vue?vue&type=script&setup=true&lang.ts
57872
- 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, table_data_grid_vue_vue_type_script_setup_true_lang_default;
58123
+ 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;
57873
58124
  var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57874
58125
  init_vue_runtime_esm_bundler();
57875
58126
  init_dataGrid();
58127
+ init_pagination();
57876
58128
  init_database();
57877
58129
  _hoisted_1$2 = { class: "table-data-grid" };
57878
58130
  _hoisted_2$2 = { class: "data-grid-wrapper" };
@@ -57912,8 +58164,9 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
57912
58164
  _hoisted_20$2 = { class: "mt-2 text-muted" };
57913
58165
  _hoisted_21$2 = { class: "grid-footer-bar mt-2 d-flex justify-content-between align-items-center px-3" };
57914
58166
  _hoisted_22$2 = { class: "pagination-info text-muted small" };
57915
- _hoisted_23$2 = { class: "page-size-selector d-flex align-items-center" };
57916
- _hoisted_24$2 = { class: "small text-muted me-2" };
58167
+ _hoisted_23$2 = { class: "footer-pagination flex-grow-1 d-flex justify-content-center" };
58168
+ _hoisted_24$2 = { class: "page-size-selector d-flex align-items-center" };
58169
+ _hoisted_25$2 = { class: "small text-muted me-2" };
57917
58170
  table_data_grid_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
57918
58171
  __name: "table-data-grid",
57919
58172
  props: {
@@ -58050,6 +58303,7 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58050
58303
  "current-page": currentPage.value,
58051
58304
  "sort-field": sortField.value,
58052
58305
  "sort-order": sortOrder.value,
58306
+ "show-pagination": false,
58053
58307
  onPageChanged: handlePageChange,
58054
58308
  onSortChanged: handleSortChange
58055
58309
  }, createSlots({
@@ -58104,33 +58358,41 @@ var init_table_data_grid_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58104
58358
  "current-page",
58105
58359
  "sort-field",
58106
58360
  "sort-order"
58107
- ])]), createBaseVNode("div", _hoisted_21$2, [createBaseVNode("div", _hoisted_22$2, toDisplayString(_ctx.$t("common.totalRecords", { count: total.value })), 1), createBaseVNode("div", _hoisted_23$2, [createBaseVNode("label", _hoisted_24$2, toDisplayString(_ctx.$t("common.pageSizeLabel")), 1), withDirectives(createBaseVNode("select", {
58108
- class: "form-select form-select-sm",
58109
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => pageSize.value = $event),
58110
- onChange: handlePageSizeChange,
58111
- style: { "width": "80px" }
58112
- }, [..._cache[5] || (_cache[5] = [
58113
- createBaseVNode("option", { value: 10 }, "10", -1),
58114
- createBaseVNode("option", { value: 20 }, "20", -1),
58115
- createBaseVNode("option", { value: 50 }, "50", -1),
58116
- createBaseVNode("option", { value: 100 }, "100", -1)
58117
- ])], 544), [[vModelSelect, pageSize.value]])])])]);
58361
+ ])]), createBaseVNode("div", _hoisted_21$2, [
58362
+ createBaseVNode("div", _hoisted_22$2, toDisplayString(_ctx.$t("common.totalRecords", { count: total.value })), 1),
58363
+ createBaseVNode("div", _hoisted_23$2, [createVNode(pagination_default, {
58364
+ "current-page": currentPage.value,
58365
+ "total-pages": totalPages.value,
58366
+ onPageChanged: handlePageChange
58367
+ }, null, 8, ["current-page", "total-pages"])]),
58368
+ createBaseVNode("div", _hoisted_24$2, [createBaseVNode("label", _hoisted_25$2, toDisplayString(_ctx.$t("common.pageSizeLabel")), 1), withDirectives(createBaseVNode("select", {
58369
+ class: "form-select form-select-sm",
58370
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => pageSize.value = $event),
58371
+ onChange: handlePageSizeChange,
58372
+ style: { "width": "80px" }
58373
+ }, [..._cache[5] || (_cache[5] = [
58374
+ createBaseVNode("option", { value: 10 }, "10", -1),
58375
+ createBaseVNode("option", { value: 20 }, "20", -1),
58376
+ createBaseVNode("option", { value: 50 }, "50", -1),
58377
+ createBaseVNode("option", { value: 100 }, "100", -1)
58378
+ ])], 544), [[vModelSelect, pageSize.value]])])
58379
+ ])]);
58118
58380
  };
58119
58381
  }
58120
58382
  });
58121
58383
  }));
58122
58384
  //#endregion
58123
- //#region src/platform/database/components/table-data-grid.vue?vue&type=style&index=0&scoped=5ed43e1b&lang.css
58124
- var init_table_data_grid_vue_vue_type_style_index_0_scoped_5ed43e1b_lang = __esmMin((() => {}));
58385
+ //#region src/platform/database/components/table-data-grid.vue?vue&type=style&index=0&scoped=f6763da8&lang.css
58386
+ var init_table_data_grid_vue_vue_type_style_index_0_scoped_f6763da8_lang = __esmMin((() => {}));
58125
58387
  //#endregion
58126
58388
  //#region src/platform/database/components/table-data-grid.vue
58127
58389
  var table_data_grid_default;
58128
58390
  var init_table_data_grid = __esmMin((() => {
58129
58391
  init_table_data_grid_vue_vue_type_script_setup_true_lang();
58130
58392
  init_table_data_grid_vue_vue_type_script_setup_true_lang();
58131
- init_table_data_grid_vue_vue_type_style_index_0_scoped_5ed43e1b_lang();
58393
+ init_table_data_grid_vue_vue_type_style_index_0_scoped_f6763da8_lang();
58132
58394
  init__plugin_vue_export_helper();
58133
- table_data_grid_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_data_grid_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-5ed43e1b"]]);
58395
+ table_data_grid_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_data_grid_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-f6763da8"]]);
58134
58396
  }));
58135
58397
  //#endregion
58136
58398
  //#region src/platform/database/components/table-detail.vue?vue&type=script&setup=true&lang.ts
@@ -58146,6 +58408,8 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58146
58408
  init_export();
58147
58409
  init_modal();
58148
58410
  init_database_types();
58411
+ init_detect();
58412
+ init_rpc();
58149
58413
  _hoisted_1$1 = { class: "table-detail" };
58150
58414
  _hoisted_2$1 = { class: "table-header" };
58151
58415
  _hoisted_3$1 = { class: "table-header-content" };
@@ -58153,9 +58417,9 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58153
58417
  _hoisted_5$1 = { class: "table-meta" };
58154
58418
  _hoisted_6$1 = { class: "table-name" };
58155
58419
  _hoisted_7$1 = { class: "table-breadcrumb" };
58156
- _hoisted_8$1 = { class: "connection" };
58157
- _hoisted_9$1 = { class: "database" };
58158
- _hoisted_10$1 = { class: "table" };
58420
+ _hoisted_8$1 = ["title"];
58421
+ _hoisted_9$1 = ["title"];
58422
+ _hoisted_10$1 = { class: "crumb crumb-current" };
58159
58423
  _hoisted_11$1 = { class: "table-stats" };
58160
58424
  _hoisted_12$1 = {
58161
58425
  key: 0,
@@ -58260,7 +58524,9 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58260
58524
  "insert-data",
58261
58525
  "export-table",
58262
58526
  "edit-row",
58263
- "execute-sql"
58527
+ "execute-sql",
58528
+ "navigate-connection",
58529
+ "navigate-database"
58264
58530
  ],
58265
58531
  setup(__props, { emit: __emit }) {
58266
58532
  const props = __props;
@@ -58504,20 +58770,27 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58504
58770
  await modal.warning(t("tableDetail.missingConnectionInfo"));
58505
58771
  return;
58506
58772
  }
58773
+ let options;
58774
+ if (isVSCode) {
58775
+ const dir = await vscodePickSaveFolder();
58776
+ if (dir === null) return;
58777
+ options = { path: dir };
58778
+ }
58507
58779
  let response;
58508
58780
  switch (format) {
58509
58781
  case "csv":
58510
- response = await databaseService.exportTableDataToCSV(props.connection.id, props.database, props.table.name);
58782
+ response = await databaseService.exportTableDataToCSV(props.connection.id, props.database, props.table.name, options);
58511
58783
  break;
58512
58784
  case "json":
58513
- response = await databaseService.exportTableDataToJSON(props.connection.id, props.database, props.table.name);
58785
+ response = await databaseService.exportTableDataToJSON(props.connection.id, props.database, props.table.name, options);
58514
58786
  break;
58515
58787
  case "excel":
58516
- response = await databaseService.exportTableDataToExcel(props.connection.id, props.database, props.table.name);
58788
+ response = await databaseService.exportTableDataToExcel(props.connection.id, props.database, props.table.name, options);
58517
58789
  break;
58518
58790
  default: throw new Error(t("tableDetail.unsupportedFormat"));
58519
58791
  }
58520
- if (response.ret === 0) await modal.success(t("tableDetail.exportSuccess", { path: response.data }));
58792
+ if (response.ret === 0) if (isVscodeWebview() && response.data) vscodeNotifyExported(response.data);
58793
+ else await modal.success(t("tableDetail.exportSuccess", { path: response.data }));
58521
58794
  else await modal.error(t("tableDetail.exportFailed") + ": " + response.msg);
58522
58795
  } catch (error) {
58523
58796
  console.error("导出表数据失败:", error);
@@ -58559,15 +58832,31 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58559
58832
  await modal.warning(t("tableDetail.missingConnectionInfo"));
58560
58833
  return;
58561
58834
  }
58562
- const response = await databaseService.exportTableDataToSQL(props.connection.id, props.database, props.table.name);
58563
- if (response.ret === 0) await modal.success(t("tableDetail.exportSuccess", { path: response.data }));
58835
+ let options;
58836
+ if (isVSCode) {
58837
+ const dir = await vscodePickSaveFolder();
58838
+ if (dir === null) return;
58839
+ options = { path: dir };
58840
+ }
58841
+ const response = await databaseService.exportTableDataToSQL(props.connection.id, props.database, props.table.name, options);
58842
+ if (response.ret === 0) if (isVscodeWebview() && response.data) vscodeNotifyExported(response.data);
58843
+ else await modal.success(t("tableDetail.exportSuccess", { path: response.data }));
58564
58844
  else await modal.error(t("tableDetail.exportFailed") + ": " + response.msg);
58565
58845
  } catch (error) {
58566
58846
  console.error("导出表数据失败:", error);
58567
58847
  modal.error(t("tableDetail.exportFailed") + ": " + error.message);
58568
58848
  }
58569
58849
  }
58570
- function downloadSQLFile(content, filename) {
58850
+ async function downloadSQLFile(content, filename) {
58851
+ if (isVscodeWebview()) {
58852
+ const saved = await vscodeSaveFile({
58853
+ filename,
58854
+ content,
58855
+ filters: { "SQL 文件": ["sql"] }
58856
+ });
58857
+ if (saved) vscodeNotifyExported(saved);
58858
+ return;
58859
+ }
58571
58860
  const blob = new Blob([content], { type: "text/sql;charset=utf-8;" });
58572
58861
  const link = document.createElement("a");
58573
58862
  if (link.download !== void 0) {
@@ -58582,11 +58871,19 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58582
58871
  }
58583
58872
  return (_ctx, _cache) => {
58584
58873
  return openBlock(), createElementBlock("div", _hoisted_1$1, [
58585
- createBaseVNode("div", _hoisted_2$1, [createBaseVNode("div", _hoisted_3$1, [createBaseVNode("div", _hoisted_4$1, [_cache[13] || (_cache[13] = 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, [
58586
- createBaseVNode("span", _hoisted_8$1, toDisplayString(__props.connection?.name), 1),
58587
- _cache[11] || (_cache[11] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
58588
- createBaseVNode("span", _hoisted_9$1, toDisplayString(__props.database), 1),
58589
- _cache[12] || (_cache[12] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
58874
+ createBaseVNode("div", _hoisted_2$1, [createBaseVNode("div", _hoisted_3$1, [createBaseVNode("div", _hoisted_4$1, [_cache[17] || (_cache[17] = 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, [
58875
+ createBaseVNode("span", {
58876
+ class: "crumb crumb-link",
58877
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("navigate-connection")),
58878
+ title: _ctx.$t("tableDetail.backToConnection")
58879
+ }, [_cache[13] || (_cache[13] = createBaseVNode("i", { class: "bi bi-hdd-network me-1" }, null, -1)), createTextVNode(toDisplayString(__props.connection?.name), 1)], 8, _hoisted_8$1),
58880
+ _cache[15] || (_cache[15] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
58881
+ createBaseVNode("span", {
58882
+ class: "crumb crumb-link",
58883
+ onClick: _cache[1] || (_cache[1] = ($event) => emit("navigate-database")),
58884
+ title: _ctx.$t("tableDetail.backToDatabase")
58885
+ }, [_cache[14] || (_cache[14] = createBaseVNode("i", { class: "bi bi-database me-1" }, null, -1)), createTextVNode(toDisplayString(__props.database), 1)], 8, _hoisted_9$1),
58886
+ _cache[16] || (_cache[16] = createBaseVNode("i", { class: "bi bi-chevron-right" }, null, -1)),
58590
58887
  createBaseVNode("span", _hoisted_10$1, toDisplayString(__props.table?.name), 1)
58591
58888
  ])])]), createBaseVNode("div", _hoisted_11$1, [
58592
58889
  __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),
@@ -58598,71 +58895,71 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58598
58895
  createBaseVNode("button", {
58599
58896
  class: "btn btn-primary btn-sm",
58600
58897
  onClick: refreshData
58601
- }, [_cache[14] || (_cache[14] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.refreshData")), 1)]),
58898
+ }, [_cache[18] || (_cache[18] = createBaseVNode("i", { class: "bi bi-arrow-clockwise" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.refreshData")), 1)]),
58602
58899
  createBaseVNode("button", {
58603
58900
  class: "btn btn-info btn-sm",
58604
58901
  onClick: editTableStructure
58605
- }, [_cache[15] || (_cache[15] = createBaseVNode("i", { class: "bi bi-pencil-square" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.modifyStructure")), 1)]),
58902
+ }, [_cache[19] || (_cache[19] = createBaseVNode("i", { class: "bi bi-pencil-square" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.modifyStructure")), 1)]),
58606
58903
  createBaseVNode("button", {
58607
58904
  class: "btn btn-success btn-sm",
58608
- onClick: _cache[0] || (_cache[0] = () => insertData())
58609
- }, [_cache[16] || (_cache[16] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.insertData")), 1)]),
58610
- createBaseVNode("div", _hoisted_26$1, [createBaseVNode("button", _hoisted_27$1, [_cache[17] || (_cache[17] = createBaseVNode("i", { class: "bi bi-download" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.exportMenu")), 1)]), createBaseVNode("ul", _hoisted_28$1, [
58905
+ onClick: _cache[2] || (_cache[2] = () => insertData())
58906
+ }, [_cache[20] || (_cache[20] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.insertData")), 1)]),
58907
+ createBaseVNode("div", _hoisted_26$1, [createBaseVNode("button", _hoisted_27$1, [_cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-download" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.exportMenu")), 1)]), createBaseVNode("ul", _hoisted_28$1, [
58611
58908
  createBaseVNode("li", null, [createBaseVNode("button", {
58612
58909
  class: "dropdown-item",
58613
- onClick: _cache[1] || (_cache[1] = ($event) => exportTableData("csv"))
58614
- }, [_cache[18] || (_cache[18] = createBaseVNode("i", { class: "bi bi-file-earmark-spreadsheet me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportCSV")), 1)])]),
58910
+ onClick: _cache[3] || (_cache[3] = ($event) => exportTableData("csv"))
58911
+ }, [_cache[22] || (_cache[22] = createBaseVNode("i", { class: "bi bi-file-earmark-spreadsheet me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportCSV")), 1)])]),
58615
58912
  createBaseVNode("li", null, [createBaseVNode("button", {
58616
58913
  class: "dropdown-item",
58617
- onClick: _cache[2] || (_cache[2] = ($event) => exportTableData("json"))
58618
- }, [_cache[19] || (_cache[19] = createBaseVNode("i", { class: "bi bi-file-earmark-code me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportJSON")), 1)])]),
58914
+ onClick: _cache[4] || (_cache[4] = ($event) => exportTableData("json"))
58915
+ }, [_cache[23] || (_cache[23] = createBaseVNode("i", { class: "bi bi-file-earmark-code me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportJSON")), 1)])]),
58619
58916
  createBaseVNode("li", null, [createBaseVNode("button", {
58620
58917
  class: "dropdown-item",
58621
- onClick: _cache[3] || (_cache[3] = ($event) => exportTableData("excel"))
58622
- }, [_cache[20] || (_cache[20] = createBaseVNode("i", { class: "bi bi-file-earmark-excel me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportExcel")), 1)])]),
58623
- _cache[23] || (_cache[23] = createBaseVNode("li", null, [createBaseVNode("hr", { class: "dropdown-divider" })], -1)),
58918
+ onClick: _cache[5] || (_cache[5] = ($event) => exportTableData("excel"))
58919
+ }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-file-earmark-excel me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportExcel")), 1)])]),
58920
+ _cache[27] || (_cache[27] = createBaseVNode("li", null, [createBaseVNode("hr", { class: "dropdown-divider" })], -1)),
58624
58921
  createBaseVNode("li", null, [createBaseVNode("button", {
58625
58922
  class: "dropdown-item",
58626
- onClick: _cache[4] || (_cache[4] = ($event) => exportTableStructure())
58627
- }, [_cache[21] || (_cache[21] = createBaseVNode("i", { class: "bi bi-file-earmark-text me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportStructure")), 1)])]),
58923
+ onClick: _cache[6] || (_cache[6] = ($event) => exportTableStructure())
58924
+ }, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-file-earmark-text me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportStructure")), 1)])]),
58628
58925
  createBaseVNode("li", null, [createBaseVNode("button", {
58629
58926
  class: "dropdown-item",
58630
- onClick: _cache[5] || (_cache[5] = ($event) => exportTableDataSQL())
58631
- }, [_cache[22] || (_cache[22] = createBaseVNode("i", { class: "bi bi-file-earmark-code me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportDataSQL")), 1)])])
58927
+ onClick: _cache[7] || (_cache[7] = ($event) => exportTableDataSQL())
58928
+ }, [_cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-file-earmark-code me-2" }, null, -1)), createTextVNode(toDisplayString(_ctx.$t("tableDetail.exportDataSQL")), 1)])])
58632
58929
  ])])
58633
58930
  ]), createBaseVNode("div", _hoisted_29$1, [__props.table?.rowCount ? (openBlock(), createElementBlock("button", {
58634
58931
  key: 0,
58635
58932
  class: "btn btn-outline-warning btn-sm",
58636
58933
  onClick: truncateTable
58637
- }, [_cache[24] || (_cache[24] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.truncateTable")), 1)])) : createCommentVNode("", true), createBaseVNode("button", {
58934
+ }, [_cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-trash" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.truncateTable")), 1)])) : createCommentVNode("", true), createBaseVNode("button", {
58638
58935
  class: "btn btn-outline-danger btn-sm",
58639
58936
  onClick: dropTable
58640
- }, [_cache[25] || (_cache[25] = createBaseVNode("i", { class: "bi bi-x-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.dropTable")), 1)])])]),
58937
+ }, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-x-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.dropTable")), 1)])])]),
58641
58938
  createBaseVNode("div", _hoisted_30$1, [createBaseVNode("ul", _hoisted_31$1, [
58642
58939
  createBaseVNode("li", _hoisted_32$1, [createBaseVNode("button", {
58643
58940
  class: normalizeClass(["nav-link", { active: activeTab.value === "data" }]),
58644
- onClick: _cache[6] || (_cache[6] = ($event) => activeTab.value = "data")
58941
+ onClick: _cache[8] || (_cache[8] = ($event) => activeTab.value = "data")
58645
58942
  }, [
58646
- _cache[26] || (_cache[26] = createBaseVNode("i", { class: "bi bi-grid" }, null, -1)),
58943
+ _cache[30] || (_cache[30] = createBaseVNode("i", { class: "bi bi-grid" }, null, -1)),
58647
58944
  createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.dataTab")) + " ", 1),
58648
58945
  __props.table?.rowCount ? (openBlock(), createElementBlock("span", _hoisted_33$1, toDisplayString(formatNumber(__props.table?.rowCount)), 1)) : createCommentVNode("", true)
58649
58946
  ], 2)]),
58650
58947
  createBaseVNode("li", _hoisted_34$1, [createBaseVNode("button", {
58651
58948
  class: normalizeClass(["nav-link", { active: activeTab.value === "structure" }]),
58652
- onClick: _cache[7] || (_cache[7] = ($event) => activeTab.value = "structure")
58653
- }, [_cache[27] || (_cache[27] = createBaseVNode("i", { class: "bi bi-diagram-3" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.structureTab")), 1)], 2)]),
58949
+ onClick: _cache[9] || (_cache[9] = ($event) => activeTab.value = "structure")
58950
+ }, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-diagram-3" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.structureTab")), 1)], 2)]),
58654
58951
  createBaseVNode("li", _hoisted_35$1, [createBaseVNode("button", {
58655
58952
  class: normalizeClass(["nav-link", { active: activeTab.value === "indexes" }]),
58656
- onClick: _cache[8] || (_cache[8] = ($event) => activeTab.value = "indexes")
58657
- }, [_cache[28] || (_cache[28] = createBaseVNode("i", { class: "bi bi-key" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.indexesTab")), 1)], 2)]),
58953
+ onClick: _cache[10] || (_cache[10] = ($event) => activeTab.value = "indexes")
58954
+ }, [_cache[32] || (_cache[32] = createBaseVNode("i", { class: "bi bi-key" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.indexesTab")), 1)], 2)]),
58658
58955
  createBaseVNode("li", _hoisted_36$1, [createBaseVNode("button", {
58659
58956
  class: normalizeClass(["nav-link", { active: activeTab.value === "relations" }]),
58660
- onClick: _cache[9] || (_cache[9] = ($event) => activeTab.value = "relations")
58661
- }, [_cache[29] || (_cache[29] = createBaseVNode("i", { class: "bi bi-link-45deg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.relationsTab")), 1)], 2)]),
58957
+ onClick: _cache[11] || (_cache[11] = ($event) => activeTab.value = "relations")
58958
+ }, [_cache[33] || (_cache[33] = createBaseVNode("i", { class: "bi bi-link-45deg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.relationsTab")), 1)], 2)]),
58662
58959
  createBaseVNode("li", _hoisted_37$1, [createBaseVNode("button", {
58663
58960
  class: normalizeClass(["nav-link", { active: activeTab.value === "sql" }]),
58664
- onClick: _cache[10] || (_cache[10] = ($event) => activeTab.value = "sql")
58665
- }, [..._cache[30] || (_cache[30] = [createBaseVNode("i", { class: "bi bi-code-slash" }, null, -1), createTextVNode(" SQL ", -1)])], 2)])
58961
+ onClick: _cache[12] || (_cache[12] = ($event) => activeTab.value = "sql")
58962
+ }, [..._cache[34] || (_cache[34] = [createBaseVNode("i", { class: "bi bi-code-slash" }, null, -1), createTextVNode(" SQL ", -1)])], 2)])
58666
58963
  ]), createBaseVNode("div", _hoisted_38$1, [
58667
58964
  withDirectives(createBaseVNode("div", _hoisted_39$1, [createVNode(table_data_grid_default, {
58668
58965
  ref_key: "tableDataGridRef",
@@ -58682,10 +58979,10 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58682
58979
  withDirectives(createBaseVNode("div", _hoisted_40$1, [createBaseVNode("div", _hoisted_41$1, [createBaseVNode("button", {
58683
58980
  class: "btn btn-success btn-sm",
58684
58981
  onClick: addColumn
58685
- }, [_cache[31] || (_cache[31] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.addColumn")), 1)]), createBaseVNode("button", {
58982
+ }, [_cache[35] || (_cache[35] = createBaseVNode("i", { class: "bi bi-plus-lg" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.addColumn")), 1)]), createBaseVNode("button", {
58686
58983
  class: "btn btn-info btn-sm",
58687
58984
  onClick: editTableStructure
58688
- }, [_cache[32] || (_cache[32] = 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, [
58985
+ }, [_cache[36] || (_cache[36] = 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, [
58689
58986
  createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.columnNameHeader")), 1),
58690
58987
  createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.dataTypeHeader")), 1),
58691
58988
  createBaseVNode("th", null, toDisplayString(_ctx.$t("tableDetail.nullableHeader")), 1),
@@ -58700,16 +58997,16 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58700
58997
  createBaseVNode("td", null, [createBaseVNode("code", null, toDisplayString(column.type), 1)]),
58701
58998
  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)]),
58702
58999
  createBaseVNode("td", null, toDisplayString(column.defaultValue || "-"), 1),
58703
- createBaseVNode("td", null, [column.isPrimary ? (openBlock(), createElementBlock("span", _hoisted_47$1, [_cache[33] || (_cache[33] = createBaseVNode("i", { class: "bi bi-key-fill" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.primaryKeyHeader")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_48, "-"))]),
58704
- createBaseVNode("td", null, [column.isAutoIncrement ? (openBlock(), createElementBlock("span", _hoisted_49, [_cache[34] || (_cache[34] = createBaseVNode("i", { class: "bi bi-arrow-up-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.autoIncHeader")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_50, "-"))]),
59000
+ createBaseVNode("td", null, [column.isPrimary ? (openBlock(), createElementBlock("span", _hoisted_47$1, [_cache[37] || (_cache[37] = createBaseVNode("i", { class: "bi bi-key-fill" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.primaryKeyHeader")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_48, "-"))]),
59001
+ createBaseVNode("td", null, [column.isAutoIncrement ? (openBlock(), createElementBlock("span", _hoisted_49, [_cache[38] || (_cache[38] = createBaseVNode("i", { class: "bi bi-arrow-up-circle" }, null, -1)), createTextVNode(" " + toDisplayString(_ctx.$t("tableDetail.autoIncHeader")), 1)])) : (openBlock(), createElementBlock("span", _hoisted_50, "-"))]),
58705
59002
  createBaseVNode("td", null, toDisplayString(column.comment || "-"), 1),
58706
59003
  createBaseVNode("td", null, [createBaseVNode("div", _hoisted_51, [createBaseVNode("button", {
58707
59004
  class: "btn btn-outline-primary btn-sm",
58708
59005
  onClick: ($event) => editColumn(column)
58709
- }, [..._cache[35] || (_cache[35] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_52), createBaseVNode("button", {
59006
+ }, [..._cache[39] || (_cache[39] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_52), createBaseVNode("button", {
58710
59007
  class: "btn btn-outline-danger btn-sm",
58711
59008
  onClick: ($event) => deleteColumn(column)
58712
- }, [..._cache[36] || (_cache[36] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_53)])])
59009
+ }, [..._cache[40] || (_cache[40] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_53)])])
58713
59010
  ]);
58714
59011
  }), 128))])])])])], 512), [[vShow, activeTab.value === "structure"]]),
58715
59012
  withDirectives(createBaseVNode("div", _hoisted_54, [createBaseVNode("div", _hoisted_55, [createBaseVNode("div", _hoisted_56, [createBaseVNode("table", _hoisted_57, [createBaseVNode("thead", _hoisted_58, [createBaseVNode("tr", null, [
@@ -58727,10 +59024,10 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58727
59024
  createBaseVNode("td", null, [createBaseVNode("div", _hoisted_61, [createBaseVNode("button", {
58728
59025
  class: "btn btn-outline-primary btn-sm",
58729
59026
  onClick: ($event) => editIndex(index)
58730
- }, [..._cache[37] || (_cache[37] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_62), createBaseVNode("button", {
59027
+ }, [..._cache[41] || (_cache[41] = [createBaseVNode("i", { class: "bi bi-pencil" }, null, -1)])], 8, _hoisted_62), createBaseVNode("button", {
58731
59028
  class: "btn btn-outline-danger btn-sm",
58732
59029
  onClick: ($event) => deleteIndex(index)
58733
- }, [..._cache[38] || (_cache[38] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_63)])])
59030
+ }, [..._cache[42] || (_cache[42] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_63)])])
58734
59031
  ]);
58735
59032
  }), 128))])])])])], 512), [[vShow, activeTab.value === "indexes"]]),
58736
59033
  withDirectives(createBaseVNode("div", _hoisted_64, [createBaseVNode("div", _hoisted_65, [createBaseVNode("div", _hoisted_66, [createBaseVNode("table", _hoisted_67, [createBaseVNode("thead", _hoisted_68, [createBaseVNode("tr", null, [
@@ -58752,7 +59049,7 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58752
59049
  createBaseVNode("td", null, [createBaseVNode("div", _hoisted_70, [createBaseVNode("button", {
58753
59050
  class: "btn btn-outline-danger btn-sm",
58754
59051
  onClick: ($event) => deleteForeignKey(fk)
58755
- }, [..._cache[39] || (_cache[39] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_71)])])
59052
+ }, [..._cache[43] || (_cache[43] = [createBaseVNode("i", { class: "bi bi-trash" }, null, -1)])], 8, _hoisted_71)])])
58756
59053
  ]);
58757
59054
  }), 128))])])])])], 512), [[vShow, activeTab.value === "relations"]]),
58758
59055
  withDirectives(createBaseVNode("div", _hoisted_72, [createBaseVNode("div", _hoisted_73, [createVNode(sql_executor_default, {
@@ -58802,17 +59099,17 @@ var init_table_detail_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58802
59099
  });
58803
59100
  }));
58804
59101
  //#endregion
58805
- //#region src/platform/database/components/table-detail.vue?vue&type=style&index=0&scoped=7e9c9695&lang.css
58806
- var init_table_detail_vue_vue_type_style_index_0_scoped_7e9c9695_lang = __esmMin((() => {}));
59102
+ //#region src/platform/database/components/table-detail.vue?vue&type=style&index=0&scoped=15c7e3be&lang.css
59103
+ var init_table_detail_vue_vue_type_style_index_0_scoped_15c7e3be_lang = __esmMin((() => {}));
58807
59104
  //#endregion
58808
59105
  //#region src/platform/database/components/table-detail.vue
58809
59106
  var table_detail_default;
58810
59107
  var init_table_detail = __esmMin((() => {
58811
59108
  init_table_detail_vue_vue_type_script_setup_true_lang();
58812
59109
  init_table_detail_vue_vue_type_script_setup_true_lang();
58813
- init_table_detail_vue_vue_type_style_index_0_scoped_7e9c9695_lang();
59110
+ init_table_detail_vue_vue_type_style_index_0_scoped_15c7e3be_lang();
58814
59111
  init__plugin_vue_export_helper();
58815
- table_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-7e9c9695"]]);
59112
+ table_detail_default = /*#__PURE__*/ _plugin_vue_export_helper_default(table_detail_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-15c7e3be"]]);
58816
59113
  }));
58817
59114
  //#endregion
58818
59115
  //#region src/platform/database/explorer.vue?vue&type=script&setup=true&lang.ts
@@ -58951,6 +59248,7 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58951
59248
  function handleRouteQuery() {
58952
59249
  const connectionId = route.query.connectionId;
58953
59250
  const database = route.query.database;
59251
+ const tableName = route.query.table;
58954
59252
  if (connectionId) {
58955
59253
  const connection = connections.value.find((conn) => conn.id === connectionId);
58956
59254
  if (connection) {
@@ -58968,12 +59266,15 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
58968
59266
  selectedTable.value = null;
58969
59267
  activeTab.value = "tables";
58970
59268
  const dbKey = `${connectionId}-${database}`;
58971
- if (!expandedDatabases.value.has(dbKey)) {
58972
- expandedDatabases.value.add(dbKey);
58973
- loadDatabaseInfo(connection, database);
58974
- loadTablesForDatabase(connection, database);
58975
- }
58976
- isUpdatingFromUrl = false;
59269
+ expandedDatabases.value.add(dbKey);
59270
+ loadDatabaseInfo(connection, database);
59271
+ loadTablesForDatabase(connection, database, true);
59272
+ if (tableName) loadTablesForDatabase(connection, database, true).then(() => {
59273
+ const t = (tableCache.value.get(dbKey) || []).find((x) => x.name === tableName);
59274
+ if (t) selectTable(connection, database, t);
59275
+ isUpdatingFromUrl = false;
59276
+ });
59277
+ else isUpdatingFromUrl = false;
58977
59278
  }, 100);
58978
59279
  else isUpdatingFromUrl = false;
58979
59280
  }
@@ -59107,6 +59408,27 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
59107
59408
  loadTableData(connection, database, table.name);
59108
59409
  loadTableStructure(connection, database, table.name);
59109
59410
  }
59411
+ /**
59412
+ * 面包屑导航:点击「连接」返回连接概览(清除数据库与表选择)。
59413
+ * 同时同步 URL query,保证宿主侧标题与前进/后退一致。
59414
+ */
59415
+ function goToConnection() {
59416
+ selectedDatabase.value = "";
59417
+ selectedTable.value = null;
59418
+ activeTab.value = "overview";
59419
+ if (!isUpdatingFromUrl) router.push({ query: { connectionId: selectedConnection.value?.id } });
59420
+ }
59421
+ /**
59422
+ * 面包屑导航:点击「数据库」返回数据库详情(清除表选择)。
59423
+ */
59424
+ function goToDatabase() {
59425
+ selectedTable.value = null;
59426
+ activeTab.value = "tables";
59427
+ if (!isUpdatingFromUrl) router.push({ query: {
59428
+ connectionId: selectedConnection.value?.id,
59429
+ database: selectedDatabase.value
59430
+ } });
59431
+ }
59110
59432
  async function loadTableData(connection, database, tableName, page = 1, pageSize = 50, searchQuery) {
59111
59433
  try {
59112
59434
  isGlobalLoading.value = true;
@@ -59574,7 +59896,8 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
59574
59896
  onSelectTable: selectTable,
59575
59897
  onRefreshDatabase: handleRefreshDatabase,
59576
59898
  onCreateTable: handleCreateTable,
59577
- onExecuteSql: handleExecuteSql
59899
+ onExecuteSql: handleExecuteSql,
59900
+ onNavigateConnection: goToConnection
59578
59901
  }, null, 8, [
59579
59902
  "connection",
59580
59903
  "database",
@@ -59600,7 +59923,9 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
59600
59923
  onTruncateTable: handleTruncateTable,
59601
59924
  onEditRow: handleEditRow,
59602
59925
  onDeleteRow: handleDeleteRow,
59603
- onExecuteSql: handleExecuteSql
59926
+ onExecuteSql: handleExecuteSql,
59927
+ onNavigateConnection: goToConnection,
59928
+ onNavigateDatabase: goToDatabase
59604
59929
  }, null, 8, [
59605
59930
  "connection",
59606
59931
  "database",
@@ -59631,8 +59956,8 @@ var init_explorer_vue_vue_type_script_setup_true_lang = __esmMin((() => {
59631
59956
  });
59632
59957
  }));
59633
59958
  //#endregion
59634
- //#region src/platform/database/explorer.vue?vue&type=style&index=0&scoped=96b10f51&lang.css
59635
- var init_explorer_vue_vue_type_style_index_0_scoped_96b10f51_lang = __esmMin((() => {}));
59959
+ //#region src/platform/database/explorer.vue?vue&type=style&index=0&scoped=50189218&lang.css
59960
+ var init_explorer_vue_vue_type_style_index_0_scoped_50189218_lang = __esmMin((() => {}));
59636
59961
  //#endregion
59637
59962
  //#region src/platform/database/explorer.vue
59638
59963
  var explorer_default;
@@ -59640,8 +59965,8 @@ var explorer_default;
59640
59965
  __esmMin((() => {
59641
59966
  init_explorer_vue_vue_type_script_setup_true_lang();
59642
59967
  init_explorer_vue_vue_type_script_setup_true_lang();
59643
- init_explorer_vue_vue_type_style_index_0_scoped_96b10f51_lang();
59968
+ init_explorer_vue_vue_type_style_index_0_scoped_50189218_lang();
59644
59969
  init__plugin_vue_export_helper();
59645
- explorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(explorer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-96b10f51"]]);
59970
+ explorer_default = /*#__PURE__*/ _plugin_vue_export_helper_default(explorer_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-50189218"]]);
59646
59971
  }))();
59647
59972
  export { explorer_default as default };