@yejiming/dsh-data-agent 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +25 -14
- package/README.md +36 -23
- package/lib/client.js +305 -213
- package/lib/client.js.map +1 -1
- package/lib/{defaults-D__D30ED.js → defaults-Dgu2B2Yq.js} +176 -10
- package/lib/index.js +8 -3
- package/lib/{query-DAjhNTo8.js → query-vK9dr7Z6.js} +1 -1
- package/lib/routes.js +18 -13
- package/lib/tool.js +5 -2
- package/lib/types/client/locales.d.ts +12 -2
- package/lib/types/client/persistence.d.ts +4 -1
- package/lib/types/clients.d.ts +15 -0
- package/lib/types/connections.d.ts +4 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/routes.d.ts +5 -0
- package/lib/types/tool.d.ts +4 -0
- package/package.json +4 -1
package/lib/client.js
CHANGED
|
@@ -37,14 +37,18 @@ window.__ModuleLoader__.load({
|
|
|
37
37
|
if (typeof candidate.host === "string") saved.host = candidate.host;
|
|
38
38
|
if (typeof candidate.port === "number" && Number.isInteger(candidate.port)) saved.port = candidate.port;
|
|
39
39
|
if (typeof candidate.user === "string") saved.user = candidate.user;
|
|
40
|
-
|
|
40
|
+
const persistPassword = candidate.persistPassword === true;
|
|
41
|
+
if (persistPassword) saved.persistPassword = true;
|
|
42
|
+
if (persistPassword && typeof candidate.password === "string") saved.password = candidate.password;
|
|
41
43
|
return saved;
|
|
42
44
|
}
|
|
43
45
|
/** Save one connection configuration (best-effort; storage failures degrade silently). */
|
|
44
46
|
function saveConnection(connection, storage = defaultStorage()) {
|
|
45
47
|
if (storage === void 0) return;
|
|
46
48
|
try {
|
|
47
|
-
|
|
49
|
+
const toWrite = { ...connection };
|
|
50
|
+
if (toWrite.persistPassword !== true) delete toWrite.password;
|
|
51
|
+
storage.setItem(CONNECTION_STORAGE_KEY, JSON.stringify(toWrite));
|
|
48
52
|
} catch {}
|
|
49
53
|
}
|
|
50
54
|
/** Load the saved connection configuration; null when absent or malformed. */
|
|
@@ -60,7 +64,7 @@ window.__ModuleLoader__.load({
|
|
|
60
64
|
}
|
|
61
65
|
//#endregion
|
|
62
66
|
//#region \0dsh-css:/Users/yejiming/Desktop/OpenSource/dsh-data-agent/src/client/DataAgentWorkbench.module.css.mjs
|
|
63
|
-
const css = ".Sv3uVW_workbench{box-sizing:border-box;font-family:var(--dsw-font-family,-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif);color:var(--dsw-alias-label-primary,inherit);flex-direction:column;gap:10px;font-size:13px;line-height:1.5;display:flex}.Sv3uVW_strip{width:100%}.Sv3uVW_docked{width:100%;max-height:55vh;overflow-y:auto}.Sv3uVW_rail{z-index:8;border-right:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-specific-sidebar-fill,var(--dsw-alias-bg-layer-1,#ffffff08));padding:12px;overflow-y:auto}html.Sv3uVW_da-split [data-phase=active] [data-conversation-scroll]>:first-child{margin-left:380px}html.Sv3uVW_da-split [data-phase=active] [data-composer-seat]{padding-left:380px}.Sv3uVW_sections{flex-direction:column;gap:12px;display:flex}.Sv3uVW_card{border:1px solid var(--dsw-alias-border-l2,#80808059);border-radius:12px;flex-direction:column;gap:10px;padding:12px 14px;display:flex}.Sv3uVW_cardTitle{text-transform:uppercase;letter-spacing:.06em;color:var(--dsw-alias-label-tertiary,#808080b3);align-items:center;gap:6px;font-size:11px;font-weight:600;display:flex}.Sv3uVW_titleIcon{width:14px;height:14px;color:var(--dsw-alias-label-secondary,#808080cc);flex:none}.Sv3uVW_fieldGrid{flex-direction:column;gap:10px;display:flex}.Sv3uVW_fieldRow2{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;display:grid}.Sv3uVW_field{flex-direction:column;gap:4px;min-width:0;display:flex}.Sv3uVW_label{color:var(--dsw-alias-label-secondary,#808080b3);font-size:11px;font-weight:500}.Sv3uVW_input{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;height:32px;color:var(--dsw-alias-label-primary,inherit);font:inherit;border-radius:8px;padding:0 10px;font-size:13px;transition:border-color .15s ease-out,box-shadow .15s ease-out}.Sv3uVW_input::placeholder{color:var(--dsw-alias-label-caption,#80808080)}.Sv3uVW_input:focus-visible,.Sv3uVW_input:focus{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_input:disabled{opacity:.55}select.Sv3uVW_input{-webkit-appearance:none;appearance:none;cursor:pointer;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%23777' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 10px center;background-repeat:no-repeat;padding-right:28px}.Sv3uVW_actions{align-items:center;gap:8px;margin-top:2px;display:flex}.Sv3uVW_actions>.Sv3uVW_primary,.Sv3uVW_actions>.Sv3uVW_ghost{flex:1}.Sv3uVW_primary,.Sv3uVW_ghost{height:32px;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;justify-content:center;align-items:center;gap:6px;padding:0 14px;font-size:13px;font-weight:500;transition:background-color .15s ease-out,border-color .15s ease-out,opacity .15s ease-out;display:inline-flex}.Sv3uVW_primary{background:var(--dsw-alias-button-info-fill,#3b82f6);color:#fff}.Sv3uVW_primary:hover:not(:disabled){background:var(--dsw-alias-button-info-hover,#3573e0)}.Sv3uVW_primary:active:not(:disabled){background:var(--dsw-static-deepseek-600,#2f5fc0)}.Sv3uVW_ghost{border-color:var(--dsw-alias-border-l2,#80808059);color:var(--dsw-alias-label-primary,inherit);background:0 0}.Sv3uVW_ghost:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_ghost:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active,#80808024)}.Sv3uVW_primary:focus-visible,.Sv3uVW_ghost:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 25%, transparent);outline:none}.Sv3uVW_primary:disabled,.Sv3uVW_ghost:disabled{opacity:.45;cursor:default}.Sv3uVW_small{border-radius:6px;height:24px;padding:0 10px;font-size:12px}.Sv3uVW_hint{color:var(--dsw-alias-label-tertiary,#80808099);font-size:12px}.Sv3uVW_summaryRow{align-items:center;gap:8px;min-height:28px;display:flex}.Sv3uVW_statusOk{color:var(--dsw-alias-state-success-primary,#22c55e);flex:none;align-items:center;gap:5px;font-size:12px;font-weight:500;display:inline-flex}.Sv3uVW_summaryType{border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);color:var(--dsw-alias-label-secondary,#808080cc);border-radius:999px;flex:none;padding:2px 8px;font-size:11px}.Sv3uVW_summaryDb{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);flex:1;font-size:12px;overflow:hidden}.Sv3uVW_summaryActions{flex:none;gap:6px;display:flex}.Sv3uVW_browseRow{border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;height:36px;color:var(--dsw-alias-label-primary,inherit);font:inherit;text-align:left;cursor:pointer;border-radius:8px;align-items:center;gap:8px;padding:0 12px;font-size:13px;font-weight:500;transition:background-color .15s ease-out,border-color .15s ease-out;display:flex}.Sv3uVW_browseRow:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l3,#80808080)}.Sv3uVW_browseRow:focus-visible{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_browseIcon{width:14px;height:14px;color:var(--dsw-alias-button-info-fill,#3b82f6);flex:none}.Sv3uVW_browseChevron{width:12px;height:12px;color:var(--dsw-alias-label-tertiary,#80808099);flex:none;margin-left:auto}.Sv3uVW_sqlInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;min-height:190px;color:var(--dsw-alias-label-primary,inherit);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);resize:vertical;border-radius:10px;padding:10px 12px;font-size:12.5px;line-height:1.6;transition:border-color .15s ease-out,box-shadow .15s ease-out}.Sv3uVW_sqlInput::placeholder{color:var(--dsw-alias-label-caption,#80808080)}.Sv3uVW_sqlInput:focus-visible,.Sv3uVW_sqlInput:focus{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_sqlInput:disabled{opacity:.55}.Sv3uVW_sqlActions{justify-content:flex-end;align-items:center;gap:10px;display:flex}.Sv3uVW_sqlActions .Sv3uVW_primary{flex:none;min-width:92px}.Sv3uVW_shortcutHint{color:var(--dsw-alias-label-caption,#80808080);font-size:11.5px}.Sv3uVW_sqlResult{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-markdown-code-block,#ffffff0a);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:200px;margin:0;padding:10px 12px;font-size:11.5px;line-height:1.55;overflow-y:auto}.Sv3uVW_errorBar{border:1px solid var(--dsw-alias-state-error-secondary,#ef444480);background:var(--dsw-alias-interactive-bg-hover-danger,#ef444414);border-radius:10px;flex-direction:column;gap:3px;padding:10px 12px;display:flex}.Sv3uVW_errorHead{color:var(--dsw-alias-state-error-primary,#ef4444);align-items:center;gap:6px;font-size:12px;font-weight:600;display:flex}.Sv3uVW_errorIcon{flex:none;width:14px;height:14px}.Sv3uVW_errorText{white-space:pre-wrap;word-break:break-word;font-size:12px}.Sv3uVW_schemaModal{width:min(900px,94vw)}.Sv3uVW_modalBody{align-items:stretch;gap:20px;height:min(540px,58vh);display:flex}.Sv3uVW_modalCol{flex-direction:column;flex:1;gap:8px;min-width:0;min-height:0;display:flex}.Sv3uVW_modalColTitle{text-transform:uppercase;letter-spacing:.06em;color:var(--dsw-alias-label-tertiary,#808080b3);flex:none;align-items:center;gap:6px;font-size:11px;font-weight:600;display:flex}.Sv3uVW_colCount{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-bg-layer-2,#ffffff0a);color:var(--dsw-alias-label-secondary,#808080cc);border-radius:999px;flex:none;padding:1px 7px;font-size:10px;font-weight:500}.Sv3uVW_treeScroll{flex:1;min-height:0;padding-right:4px;overflow-y:auto}.Sv3uVW_tree{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.Sv3uVW_treeNode{flex-direction:column;display:flex}.Sv3uVW_treeItem{width:100%;min-height:28px;color:var(--dsw-alias-label-primary,inherit);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:7px;align-items:center;gap:6px;padding:0 8px;font-size:12.5px;display:flex}.Sv3uVW_treeItem:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_treeItem.Sv3uVW_active,.Sv3uVW_treeItem.Sv3uVW_active:hover{background:var(--dsw-alias-interactive-bg-active,#3b82f62e)}.Sv3uVW_treeChevron{width:12px;height:12px;color:var(--dsw-alias-label-tertiary,#80808099);flex:none;transition:transform .15s ease-out}.Sv3uVW_treeChevron.Sv3uVW_open{transform:rotate(90deg)}.Sv3uVW_treeIcon{width:14px;height:14px;color:var(--dsw-alias-label-secondary,#808080cc);flex:none}.Sv3uVW_treeItem.Sv3uVW_active .Sv3uVW_treeIcon{color:var(--dsw-alias-button-info-fill,#3b82f6)}.Sv3uVW_treeName{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);flex:1;font-size:12px;overflow:hidden}.Sv3uVW_treeCount{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-bg-layer-2,#ffffff0a);color:var(--dsw-alias-label-secondary,#808080cc);border-radius:999px;flex:none;padding:0 6px;font-size:10px}.Sv3uVW_treeChildren{border-left:1px solid var(--dsw-alias-border-l2,#80808059);flex-direction:column;gap:1px;margin-left:12px;padding-left:10px;display:flex}.Sv3uVW_colScroll{border:1px solid var(--dsw-alias-border-l1,#80808033);border-radius:8px;flex:1;min-height:0;overflow:auto}.Sv3uVW_columnsTable{border-collapse:collapse;width:100%;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-size:12px}.Sv3uVW_columnsTable th{z-index:1;text-align:left;text-transform:uppercase;letter-spacing:.05em;color:var(--dsw-alias-label-tertiary,#808080b3);background:var(--dsw-alias-bg-layer-2,#ffffff0a);border-bottom:1px solid var(--dsw-alias-border-l2,#80808059);padding:7px 10px;font-size:10.5px;font-weight:600;position:sticky;top:0}.Sv3uVW_columnsTable td{border-bottom:1px solid var(--dsw-alias-border-l1,#80808033);color:var(--dsw-alias-label-primary,inherit);padding:5px 10px}.Sv3uVW_columnsTable tbody tr:hover td{background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_typeCell{color:var(--dsw-alias-label-secondary,#808080cc)}.Sv3uVW_nullCell{color:var(--dsw-alias-label-caption,#80808080);font-size:11px}.Sv3uVW_emptyState{border:1px dashed var(--dsw-alias-border-l2,#80808059);min-height:0;color:var(--dsw-alias-label-tertiary,#808080b3);border-radius:8px;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;display:flex}.Sv3uVW_emptyStateIcon{width:20px;height:20px;color:var(--dsw-alias-label-dimmed,#80808066)}.Sv3uVW_emptyStateText{font-size:12px}.Sv3uVW_modalHint{color:var(--dsw-alias-label-caption,#80808080);flex:none;align-items:center;gap:6px;margin-top:2px;font-size:11.5px;display:flex}@media (width<=640px){.Sv3uVW_modalBody{flex-direction:column;height:auto}.Sv3uVW_treeScroll{flex:none;height:300px}.Sv3uVW_colScroll{flex:none;height:240px}.Sv3uVW_emptyState{flex:none;height:120px}}";
|
|
67
|
+
const css = ".Sv3uVW_workbench{box-sizing:border-box;font-family:var(--dsw-font-family,-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"PingFang SC\", \"Microsoft YaHei\", sans-serif);color:var(--dsw-alias-label-primary,inherit);flex-direction:column;gap:10px;font-size:13px;line-height:1.5;display:flex}.Sv3uVW_strip{width:100%}.Sv3uVW_docked{width:100%;max-height:55vh;overflow-y:auto}.Sv3uVW_rail{z-index:8;border-right:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-specific-sidebar-fill,var(--dsw-alias-bg-layer-1,#ffffff08));padding:12px;overflow-y:auto}html.Sv3uVW_da-split [data-phase=active] [data-conversation-scroll]>:first-child{margin-left:380px}html.Sv3uVW_da-split [data-phase=active] [data-composer-seat]{padding-left:380px}.Sv3uVW_sections{flex-direction:column;gap:12px;display:flex}.Sv3uVW_card{border:1px solid var(--dsw-alias-border-l2,#80808059);border-radius:12px;flex-direction:column;gap:10px;padding:12px 14px;display:flex}.Sv3uVW_cardTitle{text-transform:uppercase;letter-spacing:.06em;color:var(--dsw-alias-label-tertiary,#808080b3);align-items:center;gap:6px;font-size:11px;font-weight:600;display:flex}.Sv3uVW_titleIcon{width:14px;height:14px;color:var(--dsw-alias-label-secondary,#808080cc);flex:none}.Sv3uVW_fieldGrid{flex-direction:column;gap:10px;display:flex}.Sv3uVW_fieldRow2{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;display:grid}.Sv3uVW_field{flex-direction:column;gap:4px;min-width:0;display:flex}.Sv3uVW_label{color:var(--dsw-alias-label-secondary,#808080b3);font-size:11px;font-weight:500}.Sv3uVW_rememberRow{color:var(--dsw-alias-label-primary,inherit);cursor:pointer;user-select:none;align-items:center;gap:6px;font-size:12px;display:flex}.Sv3uVW_rememberRow input[type=checkbox]{width:14px;height:14px;accent-color:var(--dsw-alias-button-info-fill,#3b82f6);cursor:pointer;flex:none;margin:0}.Sv3uVW_rememberHint{color:var(--dsw-alias-label-caption,#80808080);font-size:11px}.Sv3uVW_input{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;height:32px;color:var(--dsw-alias-label-primary,inherit);font:inherit;border-radius:8px;padding:0 10px;font-size:13px;transition:border-color .15s ease-out,box-shadow .15s ease-out}.Sv3uVW_input::placeholder{color:var(--dsw-alias-label-caption,#80808080)}.Sv3uVW_input:focus-visible,.Sv3uVW_input:focus{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_input:disabled{opacity:.55}select.Sv3uVW_input{-webkit-appearance:none;appearance:none;cursor:pointer;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%23777' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");background-position:right 10px center;background-repeat:no-repeat;padding-right:28px}.Sv3uVW_actions{align-items:center;gap:8px;margin-top:2px;display:flex}.Sv3uVW_actions>.Sv3uVW_primary,.Sv3uVW_actions>.Sv3uVW_ghost{flex:1}.Sv3uVW_primary,.Sv3uVW_ghost{height:32px;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;justify-content:center;align-items:center;gap:6px;padding:0 14px;font-size:13px;font-weight:500;transition:background-color .15s ease-out,border-color .15s ease-out,opacity .15s ease-out;display:inline-flex}.Sv3uVW_primary{background:var(--dsw-alias-button-info-fill,#3b82f6);color:#fff}.Sv3uVW_primary:hover:not(:disabled){background:var(--dsw-alias-button-info-hover,#3573e0)}.Sv3uVW_primary:active:not(:disabled){background:var(--dsw-static-deepseek-600,#2f5fc0)}.Sv3uVW_ghost{border-color:var(--dsw-alias-border-l2,#80808059);color:var(--dsw-alias-label-primary,inherit);background:0 0}.Sv3uVW_ghost:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_ghost:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active,#80808024)}.Sv3uVW_primary:focus-visible,.Sv3uVW_ghost:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 25%, transparent);outline:none}.Sv3uVW_primary:disabled,.Sv3uVW_ghost:disabled{opacity:.45;cursor:default}.Sv3uVW_small{border-radius:6px;height:24px;padding:0 10px;font-size:12px}.Sv3uVW_hint{color:var(--dsw-alias-label-tertiary,#80808099);font-size:12px}.Sv3uVW_summaryRow{align-items:center;gap:8px;min-height:28px;display:flex}.Sv3uVW_statusOk{color:var(--dsw-alias-state-success-primary,#22c55e);flex:none;align-items:center;gap:5px;font-size:12px;font-weight:500;display:inline-flex}.Sv3uVW_summaryType{border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);color:var(--dsw-alias-label-secondary,#808080cc);border-radius:999px;flex:none;padding:2px 8px;font-size:11px}.Sv3uVW_summaryDb{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);flex:1;font-size:12px;overflow:hidden}.Sv3uVW_summaryActions{flex:none;gap:6px;display:flex}.Sv3uVW_heroConnect{border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;color:var(--dsw-alias-label-primary,inherit);font:inherit;text-align:left;cursor:pointer;border-radius:10px;align-items:center;gap:12px;padding:14px 16px;transition:background-color .15s ease-out,border-color .15s ease-out;display:flex}.Sv3uVW_heroConnect:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l3,#80808080)}.Sv3uVW_heroConnect:focus-visible{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_heroIcon{width:22px;height:22px;color:var(--dsw-alias-button-info-fill,#3b82f6);flex:none}.Sv3uVW_heroText{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.Sv3uVW_heroTitle{color:var(--dsw-alias-label-primary,inherit);font-size:13px;font-weight:600}.Sv3uVW_heroHint{color:var(--dsw-alias-label-caption,#80808080);font-size:11.5px;line-height:1.5}.Sv3uVW_heroChevron{width:12px;height:12px;color:var(--dsw-alias-label-tertiary,#80808099);flex:none}.Sv3uVW_browseRow{border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;height:36px;color:var(--dsw-alias-label-primary,inherit);font:inherit;text-align:left;cursor:pointer;border-radius:8px;align-items:center;gap:8px;padding:0 12px;font-size:13px;font-weight:500;transition:background-color .15s ease-out,border-color .15s ease-out;display:flex}.Sv3uVW_browseRow:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014);border-color:var(--dsw-alias-border-l3,#80808080)}.Sv3uVW_browseRow:focus-visible{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_browseIcon{width:14px;height:14px;color:var(--dsw-alias-button-info-fill,#3b82f6);flex:none}.Sv3uVW_browseChevron{width:12px;height:12px;color:var(--dsw-alias-label-tertiary,#80808099);flex:none;margin-left:auto}.Sv3uVW_sqlInput{box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;min-height:190px;color:var(--dsw-alias-label-primary,inherit);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);resize:vertical;border-radius:10px;padding:10px 12px;font-size:12.5px;line-height:1.6;transition:border-color .15s ease-out,box-shadow .15s ease-out}.Sv3uVW_sqlInput::placeholder{color:var(--dsw-alias-label-caption,#80808080)}.Sv3uVW_sqlInput:focus-visible,.Sv3uVW_sqlInput:focus{border-color:var(--dsw-alias-button-info-fill,#3b82f6);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 18%, transparent);outline:none}.Sv3uVW_sqlInput:disabled{opacity:.55}.Sv3uVW_sqlActions{justify-content:flex-end;align-items:center;gap:10px;display:flex}.Sv3uVW_sqlActions .Sv3uVW_primary{flex:none;min-width:92px}.Sv3uVW_shortcutHint{color:var(--dsw-alias-label-caption,#80808080);font-size:11.5px}.Sv3uVW_sqlResult{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-markdown-code-block,#ffffff0a);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);white-space:pre-wrap;word-break:break-word;border-radius:8px;max-height:200px;margin:0;padding:10px 12px;font-size:11.5px;line-height:1.55;overflow-y:auto}.Sv3uVW_errorBar{border:1px solid var(--dsw-alias-state-error-secondary,#ef444480);background:var(--dsw-alias-interactive-bg-hover-danger,#ef444414);border-radius:10px;flex-direction:column;gap:3px;padding:10px 12px;display:flex}.Sv3uVW_errorHead{color:var(--dsw-alias-state-error-primary,#ef4444);align-items:center;gap:6px;font-size:12px;font-weight:600;display:flex}.Sv3uVW_errorIcon{flex:none;width:14px;height:14px}.Sv3uVW_errorText{white-space:pre-wrap;word-break:break-word;font-size:12px}.Sv3uVW_connectModal{width:min(440px,92vw)}.Sv3uVW_connectModalBody{flex-direction:column;gap:14px;display:flex}.Sv3uVW_schemaModal{width:min(900px,94vw)}.Sv3uVW_modalBody{align-items:stretch;gap:20px;height:min(540px,58vh);display:flex}.Sv3uVW_modalCol{flex-direction:column;flex:1;gap:8px;min-width:0;min-height:0;display:flex}.Sv3uVW_modalColTitle{text-transform:uppercase;letter-spacing:.06em;color:var(--dsw-alias-label-tertiary,#808080b3);flex:none;align-items:center;gap:6px;font-size:11px;font-weight:600;display:flex}.Sv3uVW_colCount{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-bg-layer-2,#ffffff0a);color:var(--dsw-alias-label-secondary,#808080cc);border-radius:999px;flex:none;padding:1px 7px;font-size:10px;font-weight:500}.Sv3uVW_treeScroll{flex:1;min-height:0;padding-right:4px;overflow-y:auto}.Sv3uVW_tree{flex-direction:column;gap:1px;margin:0;padding:0;list-style:none;display:flex}.Sv3uVW_treeNode{flex-direction:column;display:flex}.Sv3uVW_treeItem{width:100%;min-height:28px;color:var(--dsw-alias-label-primary,inherit);font:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:7px;align-items:center;gap:6px;padding:0 8px;font-size:12.5px;display:flex}.Sv3uVW_treeItem:hover{background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_treeItem.Sv3uVW_active,.Sv3uVW_treeItem.Sv3uVW_active:hover{background:var(--dsw-alias-interactive-bg-active,#3b82f62e)}.Sv3uVW_treeChevron{width:12px;height:12px;color:var(--dsw-alias-label-tertiary,#80808099);flex:none;transition:transform .15s ease-out}.Sv3uVW_treeChevron.Sv3uVW_open{transform:rotate(90deg)}.Sv3uVW_treeIcon{width:14px;height:14px;color:var(--dsw-alias-label-secondary,#808080cc);flex:none}.Sv3uVW_treeItem.Sv3uVW_active .Sv3uVW_treeIcon{color:var(--dsw-alias-button-info-fill,#3b82f6)}.Sv3uVW_treeName{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);flex:1;font-size:12px;overflow:hidden}.Sv3uVW_treeCount{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-bg-layer-2,#ffffff0a);color:var(--dsw-alias-label-secondary,#808080cc);border-radius:999px;flex:none;padding:0 6px;font-size:10px}.Sv3uVW_treeChildren{border-left:1px solid var(--dsw-alias-border-l2,#80808059);flex-direction:column;gap:1px;margin-left:12px;padding-left:10px;display:flex}.Sv3uVW_colScroll{border:1px solid var(--dsw-alias-border-l1,#80808033);border-radius:8px;flex:1;min-height:0;overflow:auto}.Sv3uVW_columnsTable{border-collapse:collapse;width:100%;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);font-size:12px}.Sv3uVW_columnsTable th{z-index:1;text-align:left;text-transform:uppercase;letter-spacing:.05em;color:var(--dsw-alias-label-tertiary,#808080b3);background:var(--dsw-alias-bg-layer-2,#ffffff0a);border-bottom:1px solid var(--dsw-alias-border-l2,#80808059);padding:7px 10px;font-size:10.5px;font-weight:600;position:sticky;top:0}.Sv3uVW_columnsTable td{border-bottom:1px solid var(--dsw-alias-border-l1,#80808033);color:var(--dsw-alias-label-primary,inherit);padding:5px 10px}.Sv3uVW_columnsTable tbody tr:hover td{background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_typeCell{color:var(--dsw-alias-label-secondary,#808080cc)}.Sv3uVW_nullCell{color:var(--dsw-alias-label-caption,#80808080);font-size:11px}.Sv3uVW_emptyState{border:1px dashed var(--dsw-alias-border-l2,#80808059);min-height:0;color:var(--dsw-alias-label-tertiary,#808080b3);border-radius:8px;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;display:flex}.Sv3uVW_emptyStateIcon{width:20px;height:20px;color:var(--dsw-alias-label-dimmed,#80808066)}.Sv3uVW_emptyStateText{font-size:12px}.Sv3uVW_modalHint{color:var(--dsw-alias-label-caption,#80808080);flex:none;align-items:center;gap:6px;margin-top:2px;font-size:11.5px;display:flex}@media (width<=640px){.Sv3uVW_modalBody{flex-direction:column;height:auto}.Sv3uVW_treeScroll{flex:none;height:300px}.Sv3uVW_colScroll{flex:none;height:240px}.Sv3uVW_emptyState{flex:none;height:120px}}";
|
|
64
68
|
const tagId = "@yejiming/dsh-data-agent/DataAgentWorkbench.module.css";
|
|
65
69
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
66
70
|
const tag = document.createElement("style");
|
|
@@ -70,65 +74,75 @@ window.__ModuleLoader__.load({
|
|
|
70
74
|
document.head.appendChild(tag);
|
|
71
75
|
}
|
|
72
76
|
var DataAgentWorkbench_module_css_default = {
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"statusOk": "Sv3uVW_statusOk",
|
|
77
|
-
"colScroll": "Sv3uVW_colScroll",
|
|
78
|
-
"ghost": "Sv3uVW_ghost",
|
|
79
|
-
"summaryType": "Sv3uVW_summaryType",
|
|
80
|
-
"summaryActions": "Sv3uVW_summaryActions",
|
|
77
|
+
"input": "Sv3uVW_input",
|
|
78
|
+
"emptyStateIcon": "Sv3uVW_emptyStateIcon",
|
|
79
|
+
"field": "Sv3uVW_field",
|
|
81
80
|
"browseRow": "Sv3uVW_browseRow",
|
|
82
|
-
"errorIcon": "Sv3uVW_errorIcon",
|
|
83
|
-
"schemaModal": "Sv3uVW_schemaModal",
|
|
84
|
-
"primary": "Sv3uVW_primary",
|
|
85
|
-
"errorBar": "Sv3uVW_errorBar",
|
|
86
|
-
"tree": "Sv3uVW_tree",
|
|
87
|
-
"active": "Sv3uVW_active",
|
|
88
|
-
"modalHint": "Sv3uVW_modalHint",
|
|
89
81
|
"treeScroll": "Sv3uVW_treeScroll",
|
|
90
|
-
"
|
|
91
|
-
"
|
|
82
|
+
"treeIcon": "Sv3uVW_treeIcon",
|
|
83
|
+
"summaryRow": "Sv3uVW_summaryRow",
|
|
84
|
+
"heroHint": "Sv3uVW_heroHint",
|
|
85
|
+
"fieldGrid": "Sv3uVW_fieldGrid",
|
|
86
|
+
"heroChevron": "Sv3uVW_heroChevron",
|
|
87
|
+
"browseIcon": "Sv3uVW_browseIcon",
|
|
88
|
+
"sqlActions": "Sv3uVW_sqlActions",
|
|
89
|
+
"errorHead": "Sv3uVW_errorHead",
|
|
90
|
+
"modalCol": "Sv3uVW_modalCol",
|
|
91
|
+
"colScroll": "Sv3uVW_colScroll",
|
|
92
|
+
"heroConnect": "Sv3uVW_heroConnect",
|
|
93
|
+
"connectModalBody": "Sv3uVW_connectModalBody",
|
|
92
94
|
"strip": "Sv3uVW_strip",
|
|
93
|
-
"
|
|
95
|
+
"sqlInput": "Sv3uVW_sqlInput",
|
|
96
|
+
"rememberHint": "Sv3uVW_rememberHint",
|
|
97
|
+
"fieldRow2": "Sv3uVW_fieldRow2",
|
|
98
|
+
"rememberRow": "Sv3uVW_rememberRow",
|
|
99
|
+
"statusOk": "Sv3uVW_statusOk",
|
|
94
100
|
"typeCell": "Sv3uVW_typeCell",
|
|
95
101
|
"summaryDb": "Sv3uVW_summaryDb",
|
|
96
|
-
"label": "Sv3uVW_label",
|
|
97
|
-
"emptyStateText": "Sv3uVW_emptyStateText",
|
|
98
|
-
"shortcutHint": "Sv3uVW_shortcutHint",
|
|
99
102
|
"rail": "Sv3uVW_rail",
|
|
103
|
+
"da-split": "Sv3uVW_da-split",
|
|
104
|
+
"colCount": "Sv3uVW_colCount",
|
|
105
|
+
"errorBar": "Sv3uVW_errorBar",
|
|
106
|
+
"treeItem": "Sv3uVW_treeItem",
|
|
107
|
+
"sections": "Sv3uVW_sections",
|
|
108
|
+
"cardTitle": "Sv3uVW_cardTitle",
|
|
109
|
+
"errorText": "Sv3uVW_errorText",
|
|
110
|
+
"docked": "Sv3uVW_docked",
|
|
111
|
+
"heroIcon": "Sv3uVW_heroIcon",
|
|
112
|
+
"primary": "Sv3uVW_primary",
|
|
100
113
|
"card": "Sv3uVW_card",
|
|
101
|
-
"
|
|
114
|
+
"ghost": "Sv3uVW_ghost",
|
|
115
|
+
"tree": "Sv3uVW_tree",
|
|
116
|
+
"titleIcon": "Sv3uVW_titleIcon",
|
|
117
|
+
"small": "Sv3uVW_small",
|
|
118
|
+
"actions": "Sv3uVW_actions",
|
|
119
|
+
"emptyStateText": "Sv3uVW_emptyStateText",
|
|
120
|
+
"label": "Sv3uVW_label",
|
|
121
|
+
"active": "Sv3uVW_active",
|
|
122
|
+
"summaryActions": "Sv3uVW_summaryActions",
|
|
123
|
+
"shortcutHint": "Sv3uVW_shortcutHint",
|
|
124
|
+
"treeNode": "Sv3uVW_treeNode",
|
|
125
|
+
"treeCount": "Sv3uVW_treeCount",
|
|
102
126
|
"treeChevron": "Sv3uVW_treeChevron",
|
|
127
|
+
"heroTitle": "Sv3uVW_heroTitle",
|
|
128
|
+
"open": "Sv3uVW_open",
|
|
129
|
+
"modalColTitle": "Sv3uVW_modalColTitle",
|
|
103
130
|
"emptyState": "Sv3uVW_emptyState",
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"treeChildren": "Sv3uVW_treeChildren",
|
|
107
|
-
"actions": "Sv3uVW_actions",
|
|
131
|
+
"modalHint": "Sv3uVW_modalHint",
|
|
132
|
+
"errorIcon": "Sv3uVW_errorIcon",
|
|
108
133
|
"hint": "Sv3uVW_hint",
|
|
109
|
-
"field": "Sv3uVW_field",
|
|
110
|
-
"columnsTable": "Sv3uVW_columnsTable",
|
|
111
134
|
"nullCell": "Sv3uVW_nullCell",
|
|
112
135
|
"workbench": "Sv3uVW_workbench",
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"summaryRow": "Sv3uVW_summaryRow",
|
|
117
|
-
"sqlResult": "Sv3uVW_sqlResult",
|
|
118
|
-
"input": "Sv3uVW_input",
|
|
119
|
-
"treeItem": "Sv3uVW_treeItem",
|
|
120
|
-
"fieldGrid": "Sv3uVW_fieldGrid",
|
|
121
|
-
"errorHead": "Sv3uVW_errorHead",
|
|
122
|
-
"da-split": "Sv3uVW_da-split",
|
|
123
|
-
"sections": "Sv3uVW_sections",
|
|
124
|
-
"treeIcon": "Sv3uVW_treeIcon",
|
|
125
|
-
"browseIcon": "Sv3uVW_browseIcon",
|
|
126
|
-
"emptyStateIcon": "Sv3uVW_emptyStateIcon",
|
|
127
|
-
"fieldRow2": "Sv3uVW_fieldRow2",
|
|
128
|
-
"titleIcon": "Sv3uVW_titleIcon",
|
|
129
|
-
"colCount": "Sv3uVW_colCount",
|
|
136
|
+
"schemaModal": "Sv3uVW_schemaModal",
|
|
137
|
+
"browseChevron": "Sv3uVW_browseChevron",
|
|
138
|
+
"connectModal": "Sv3uVW_connectModal",
|
|
130
139
|
"treeName": "Sv3uVW_treeName",
|
|
131
|
-
"
|
|
140
|
+
"modalBody": "Sv3uVW_modalBody",
|
|
141
|
+
"sqlResult": "Sv3uVW_sqlResult",
|
|
142
|
+
"heroText": "Sv3uVW_heroText",
|
|
143
|
+
"summaryType": "Sv3uVW_summaryType",
|
|
144
|
+
"columnsTable": "Sv3uVW_columnsTable",
|
|
145
|
+
"treeChildren": "Sv3uVW_treeChildren"
|
|
132
146
|
};
|
|
133
147
|
//#endregion
|
|
134
148
|
//#region src/client/DataAgentWorkbench.tsx
|
|
@@ -383,11 +397,13 @@ window.__ModuleLoader__.load({
|
|
|
383
397
|
const [port, setPort] = (0, react.useState)(initialSaved?.port !== void 0 ? String(initialSaved.port) : defaultPortOf(initialSaved?.type ?? "mysql"));
|
|
384
398
|
const [user, setUser] = (0, react.useState)(initialSaved?.user ?? "");
|
|
385
399
|
const [password, setPassword] = (0, react.useState)(initialSaved?.password ?? "");
|
|
400
|
+
const [rememberPassword, setRememberPassword] = (0, react.useState)(initialSaved?.persistPassword === true);
|
|
401
|
+
const [readonly, setReadonly] = (0, react.useState)(false);
|
|
386
402
|
const [database, setDatabase] = (0, react.useState)(initialSaved?.database ?? "");
|
|
387
403
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
388
404
|
const [error, setError] = (0, react.useState)(null);
|
|
389
405
|
const [connected, setConnected] = (0, react.useState)(false);
|
|
390
|
-
const [
|
|
406
|
+
const [connectModalOpen, setConnectModalOpen] = (0, react.useState)(false);
|
|
391
407
|
const [restoring, setRestoring] = (0, react.useState)(false);
|
|
392
408
|
const [schemaModalOpen, setSchemaModalOpen] = (0, react.useState)(false);
|
|
393
409
|
const [schemas, setSchemas] = (0, react.useState)([]);
|
|
@@ -453,6 +469,7 @@ window.__ModuleLoader__.load({
|
|
|
453
469
|
} : {},
|
|
454
470
|
...type !== "sqlite" && port !== "" ? { port: Number(port) } : {},
|
|
455
471
|
...password !== "" ? { password } : {},
|
|
472
|
+
...rememberPassword ? { persistPassword: true } : {},
|
|
456
473
|
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
457
474
|
});
|
|
458
475
|
}, [
|
|
@@ -461,7 +478,8 @@ window.__ModuleLoader__.load({
|
|
|
461
478
|
port,
|
|
462
479
|
user,
|
|
463
480
|
database,
|
|
464
|
-
password
|
|
481
|
+
password,
|
|
482
|
+
rememberPassword
|
|
465
483
|
]);
|
|
466
484
|
(0, react.useEffect)(() => {
|
|
467
485
|
let cancelled = false;
|
|
@@ -477,6 +495,7 @@ window.__ModuleLoader__.load({
|
|
|
477
495
|
setPort(body.summary.port !== void 0 ? String(body.summary.port) : "");
|
|
478
496
|
setUser(body.summary.user ?? "");
|
|
479
497
|
setDatabase(body.summary.database);
|
|
498
|
+
setReadonly(body.summary.readonly === true);
|
|
480
499
|
}
|
|
481
500
|
const schemasBody = await (await fetch(`/plugins/data-agent/schemas?sessionId=${encodeURIComponent(sessionId)}`)).json();
|
|
482
501
|
if (!cancelled && schemasBody.ok) setSchemas(schemasBody.schemas ?? []);
|
|
@@ -489,7 +508,7 @@ window.__ModuleLoader__.load({
|
|
|
489
508
|
if (cancelled) return;
|
|
490
509
|
if (result.ok) {
|
|
491
510
|
setConnected(true);
|
|
492
|
-
|
|
511
|
+
setConnectModalOpen(false);
|
|
493
512
|
const schemasBody = await (await fetch(`/plugins/data-agent/schemas?sessionId=${encodeURIComponent(sessionId)}`)).json();
|
|
494
513
|
if (!cancelled && schemasBody.ok) setSchemas(schemasBody.schemas ?? []);
|
|
495
514
|
} else setError(`连接恢复失败:${result.error ?? "unknown error"}`);
|
|
@@ -512,7 +531,8 @@ window.__ModuleLoader__.load({
|
|
|
512
531
|
setError(null);
|
|
513
532
|
const body = {
|
|
514
533
|
sessionId,
|
|
515
|
-
type
|
|
534
|
+
type,
|
|
535
|
+
readonly
|
|
516
536
|
};
|
|
517
537
|
if (sqlite) body.database = database;
|
|
518
538
|
else {
|
|
@@ -526,7 +546,7 @@ window.__ModuleLoader__.load({
|
|
|
526
546
|
const result = await performConnect(sessionId, body);
|
|
527
547
|
if (result.ok) {
|
|
528
548
|
setConnected(true);
|
|
529
|
-
|
|
549
|
+
setConnectModalOpen(false);
|
|
530
550
|
const schemasBody = await (await fetch(`/plugins/data-agent/schemas?sessionId=${encodeURIComponent(sessionId)}`)).json();
|
|
531
551
|
if (schemasBody.ok) setSchemas(schemasBody.schemas ?? []);
|
|
532
552
|
} else setError(result.error ?? "unknown error");
|
|
@@ -546,7 +566,7 @@ window.__ModuleLoader__.load({
|
|
|
546
566
|
body: JSON.stringify({ sessionId })
|
|
547
567
|
});
|
|
548
568
|
setConnected(false);
|
|
549
|
-
|
|
569
|
+
setReadonly(false);
|
|
550
570
|
setSchemaModalOpen(false);
|
|
551
571
|
setSchemas([]);
|
|
552
572
|
setActiveSchema(null);
|
|
@@ -642,7 +662,7 @@ window.__ModuleLoader__.load({
|
|
|
642
662
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
643
663
|
className: DataAgentWorkbench_module_css_default.sections,
|
|
644
664
|
children: [
|
|
645
|
-
connected
|
|
665
|
+
connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
646
666
|
className: DataAgentWorkbench_module_css_default.card,
|
|
647
667
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
648
668
|
className: DataAgentWorkbench_module_css_default.summaryRow,
|
|
@@ -670,7 +690,7 @@ window.__ModuleLoader__.load({
|
|
|
670
690
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
671
691
|
type: "button",
|
|
672
692
|
className: `${DataAgentWorkbench_module_css_default.ghost} ${DataAgentWorkbench_module_css_default.small}`,
|
|
673
|
-
onClick: () =>
|
|
693
|
+
onClick: () => setConnectModalOpen(true),
|
|
674
694
|
children: t("action.config")
|
|
675
695
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
676
696
|
type: "button",
|
|
@@ -684,159 +704,27 @@ window.__ModuleLoader__.load({
|
|
|
684
704
|
})
|
|
685
705
|
]
|
|
686
706
|
})
|
|
687
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.
|
|
707
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
688
708
|
className: DataAgentWorkbench_module_css_default.card,
|
|
689
|
-
children:
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
698
|
-
className: DataAgentWorkbench_module_css_default.
|
|
699
|
-
children:
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
setType(next);
|
|
709
|
-
setPort(next === "postgres" ? "5432" : next === "mysql" ? "3306" : next === "oracle" ? "1521" : next === "hive" ? "10000" : next === "impala" ? "21050" : "");
|
|
710
|
-
},
|
|
711
|
-
children: [
|
|
712
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
713
|
-
value: "mysql",
|
|
714
|
-
children: t("type.mysql")
|
|
715
|
-
}),
|
|
716
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
717
|
-
value: "postgres",
|
|
718
|
-
children: t("type.postgres")
|
|
719
|
-
}),
|
|
720
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
721
|
-
value: "sqlite",
|
|
722
|
-
children: t("type.sqlite")
|
|
723
|
-
}),
|
|
724
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
725
|
-
value: "oracle",
|
|
726
|
-
children: t("type.oracle")
|
|
727
|
-
}),
|
|
728
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
729
|
-
value: "hive",
|
|
730
|
-
children: t("type.hive")
|
|
731
|
-
}),
|
|
732
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
733
|
-
value: "impala",
|
|
734
|
-
children: t("type.impala")
|
|
735
|
-
})
|
|
736
|
-
]
|
|
737
|
-
})]
|
|
738
|
-
}),
|
|
739
|
-
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
740
|
-
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
741
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
742
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
743
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
744
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
745
|
-
children: t("form.host")
|
|
746
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
747
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
748
|
-
type: "text",
|
|
749
|
-
value: host,
|
|
750
|
-
disabled: formDisabled,
|
|
751
|
-
onChange: (event) => setHost(event.target.value)
|
|
752
|
-
})]
|
|
753
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
754
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
755
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
756
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
757
|
-
children: t("form.port")
|
|
758
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
759
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
760
|
-
type: "number",
|
|
761
|
-
min: 1,
|
|
762
|
-
max: 65535,
|
|
763
|
-
value: port,
|
|
764
|
-
disabled: formDisabled,
|
|
765
|
-
onChange: (event) => setPort(event.target.value)
|
|
766
|
-
})]
|
|
767
|
-
})]
|
|
768
|
-
}),
|
|
769
|
-
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
770
|
-
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
771
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
772
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
773
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
774
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
775
|
-
children: t("form.user")
|
|
776
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
777
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
778
|
-
type: "text",
|
|
779
|
-
value: user,
|
|
780
|
-
disabled: formDisabled,
|
|
781
|
-
onChange: (event) => setUser(event.target.value)
|
|
782
|
-
})]
|
|
783
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
784
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
785
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
786
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
787
|
-
children: t("form.password")
|
|
788
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
789
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
790
|
-
type: "password",
|
|
791
|
-
value: password,
|
|
792
|
-
autoComplete: "new-password",
|
|
793
|
-
disabled: formDisabled,
|
|
794
|
-
onChange: (event) => setPassword(event.target.value)
|
|
795
|
-
})]
|
|
796
|
-
})]
|
|
797
|
-
}),
|
|
798
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
799
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
800
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
801
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
802
|
-
children: databaseLabel
|
|
803
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
804
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
805
|
-
type: "text",
|
|
806
|
-
value: database,
|
|
807
|
-
placeholder: sqlite ? t("form.database.sqlite.placeholder") : void 0,
|
|
808
|
-
disabled: formDisabled,
|
|
809
|
-
onChange: (event) => setDatabase(event.target.value)
|
|
810
|
-
})]
|
|
811
|
-
})
|
|
812
|
-
]
|
|
813
|
-
}),
|
|
814
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
815
|
-
className: DataAgentWorkbench_module_css_default.actions,
|
|
816
|
-
children: !connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
817
|
-
type: "button",
|
|
818
|
-
className: DataAgentWorkbench_module_css_default.primary,
|
|
819
|
-
disabled: busy || database === "" || !sqlite && host === "",
|
|
820
|
-
onClick: () => {
|
|
821
|
-
connect();
|
|
822
|
-
},
|
|
823
|
-
children: restoring ? t("state.reconnecting") : busy ? t("state.checking") : t("action.connect")
|
|
824
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
825
|
-
type: "button",
|
|
826
|
-
className: DataAgentWorkbench_module_css_default.ghost,
|
|
827
|
-
onClick: () => setConfigOpen(false),
|
|
828
|
-
children: t("action.collapse")
|
|
829
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
830
|
-
type: "button",
|
|
831
|
-
className: DataAgentWorkbench_module_css_default.ghost,
|
|
832
|
-
disabled: busy,
|
|
833
|
-
onClick: () => {
|
|
834
|
-
disconnect();
|
|
835
|
-
},
|
|
836
|
-
children: t("action.disconnect")
|
|
837
|
-
})] })
|
|
838
|
-
})
|
|
839
|
-
]
|
|
709
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
710
|
+
type: "button",
|
|
711
|
+
className: DataAgentWorkbench_module_css_default.heroConnect,
|
|
712
|
+
onClick: () => setConnectModalOpen(true),
|
|
713
|
+
children: [
|
|
714
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DatabaseIcon, { className: DataAgentWorkbench_module_css_default.heroIcon }),
|
|
715
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
716
|
+
className: DataAgentWorkbench_module_css_default.heroText,
|
|
717
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
718
|
+
className: DataAgentWorkbench_module_css_default.heroTitle,
|
|
719
|
+
children: t("form.hero.title")
|
|
720
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
721
|
+
className: DataAgentWorkbench_module_css_default.heroHint,
|
|
722
|
+
children: t("form.hero.hint")
|
|
723
|
+
})]
|
|
724
|
+
}),
|
|
725
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronIcon, { className: DataAgentWorkbench_module_css_default.heroChevron })
|
|
726
|
+
]
|
|
727
|
+
})
|
|
840
728
|
}),
|
|
841
729
|
connected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
842
730
|
className: DataAgentWorkbench_module_css_default.card,
|
|
@@ -851,7 +739,7 @@ window.__ModuleLoader__.load({
|
|
|
851
739
|
]
|
|
852
740
|
})
|
|
853
741
|
}),
|
|
854
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
742
|
+
connected && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
855
743
|
className: DataAgentWorkbench_module_css_default.card,
|
|
856
744
|
children: [
|
|
857
745
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -895,7 +783,7 @@ window.__ModuleLoader__.load({
|
|
|
895
783
|
})
|
|
896
784
|
]
|
|
897
785
|
}),
|
|
898
|
-
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
786
|
+
error !== null && !connectModalOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
899
787
|
className: DataAgentWorkbench_module_css_default.errorBar,
|
|
900
788
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
901
789
|
className: DataAgentWorkbench_module_css_default.errorHead,
|
|
@@ -1009,6 +897,200 @@ window.__ModuleLoader__.load({
|
|
|
1009
897
|
})]
|
|
1010
898
|
})]
|
|
1011
899
|
})
|
|
900
|
+
}),
|
|
901
|
+
connectModalOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
902
|
+
open: connectModalOpen,
|
|
903
|
+
onClose: () => setConnectModalOpen(false),
|
|
904
|
+
title: t("form.title"),
|
|
905
|
+
closeLabel: t("action.close"),
|
|
906
|
+
className: DataAgentWorkbench_module_css_default.connectModal,
|
|
907
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
908
|
+
className: DataAgentWorkbench_module_css_default.connectModalBody,
|
|
909
|
+
children: [
|
|
910
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
911
|
+
className: DataAgentWorkbench_module_css_default.fieldGrid,
|
|
912
|
+
children: [
|
|
913
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
914
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
915
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
916
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
917
|
+
children: t("form.type")
|
|
918
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
919
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
920
|
+
value: type,
|
|
921
|
+
disabled: formDisabled,
|
|
922
|
+
onChange: (event) => {
|
|
923
|
+
const next = event.target.value;
|
|
924
|
+
setType(next);
|
|
925
|
+
setPort(next === "postgres" ? "5432" : next === "mysql" ? "3306" : next === "oracle" ? "1521" : next === "hive" ? "10000" : next === "impala" ? "21050" : "");
|
|
926
|
+
},
|
|
927
|
+
children: [
|
|
928
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
929
|
+
value: "mysql",
|
|
930
|
+
children: t("type.mysql")
|
|
931
|
+
}),
|
|
932
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
933
|
+
value: "postgres",
|
|
934
|
+
children: t("type.postgres")
|
|
935
|
+
}),
|
|
936
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
937
|
+
value: "sqlite",
|
|
938
|
+
children: t("type.sqlite")
|
|
939
|
+
}),
|
|
940
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
941
|
+
value: "oracle",
|
|
942
|
+
children: t("type.oracle")
|
|
943
|
+
}),
|
|
944
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
945
|
+
value: "hive",
|
|
946
|
+
children: t("type.hive")
|
|
947
|
+
}),
|
|
948
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
949
|
+
value: "impala",
|
|
950
|
+
children: t("type.impala")
|
|
951
|
+
})
|
|
952
|
+
]
|
|
953
|
+
})]
|
|
954
|
+
}),
|
|
955
|
+
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
956
|
+
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
957
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
958
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
959
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
960
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
961
|
+
children: t("form.host")
|
|
962
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
963
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
964
|
+
type: "text",
|
|
965
|
+
value: host,
|
|
966
|
+
disabled: formDisabled,
|
|
967
|
+
onChange: (event) => setHost(event.target.value)
|
|
968
|
+
})]
|
|
969
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
970
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
971
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
972
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
973
|
+
children: t("form.port")
|
|
974
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
975
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
976
|
+
type: "number",
|
|
977
|
+
min: 1,
|
|
978
|
+
max: 65535,
|
|
979
|
+
value: port,
|
|
980
|
+
disabled: formDisabled,
|
|
981
|
+
onChange: (event) => setPort(event.target.value)
|
|
982
|
+
})]
|
|
983
|
+
})]
|
|
984
|
+
}),
|
|
985
|
+
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
986
|
+
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
987
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
988
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
989
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
990
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
991
|
+
children: t("form.user")
|
|
992
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
993
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
994
|
+
type: "text",
|
|
995
|
+
value: user,
|
|
996
|
+
disabled: formDisabled,
|
|
997
|
+
onChange: (event) => setUser(event.target.value)
|
|
998
|
+
})]
|
|
999
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1000
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
1001
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1002
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
1003
|
+
children: t("form.password")
|
|
1004
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1005
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
1006
|
+
type: "password",
|
|
1007
|
+
value: password,
|
|
1008
|
+
autoComplete: "new-password",
|
|
1009
|
+
disabled: formDisabled,
|
|
1010
|
+
onChange: (event) => setPassword(event.target.value)
|
|
1011
|
+
})]
|
|
1012
|
+
})]
|
|
1013
|
+
}),
|
|
1014
|
+
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1015
|
+
className: DataAgentWorkbench_module_css_default.rememberRow,
|
|
1016
|
+
children: [
|
|
1017
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1018
|
+
type: "checkbox",
|
|
1019
|
+
checked: rememberPassword,
|
|
1020
|
+
disabled: formDisabled,
|
|
1021
|
+
onChange: (event) => setRememberPassword(event.target.checked)
|
|
1022
|
+
}),
|
|
1023
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("form.rememberPassword") }),
|
|
1024
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1025
|
+
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
1026
|
+
children: t("form.rememberPassword.hint")
|
|
1027
|
+
})
|
|
1028
|
+
]
|
|
1029
|
+
}),
|
|
1030
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1031
|
+
className: DataAgentWorkbench_module_css_default.rememberRow,
|
|
1032
|
+
children: [
|
|
1033
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1034
|
+
type: "checkbox",
|
|
1035
|
+
checked: readonly,
|
|
1036
|
+
disabled: formDisabled,
|
|
1037
|
+
onChange: (event) => setReadonly(event.target.checked)
|
|
1038
|
+
}),
|
|
1039
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("form.readonly") }),
|
|
1040
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1041
|
+
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
1042
|
+
children: t("form.readonly.hint")
|
|
1043
|
+
})
|
|
1044
|
+
]
|
|
1045
|
+
}),
|
|
1046
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1047
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
1048
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1049
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
1050
|
+
children: databaseLabel
|
|
1051
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1052
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
1053
|
+
type: "text",
|
|
1054
|
+
value: database,
|
|
1055
|
+
placeholder: sqlite ? t("form.database.sqlite.placeholder") : void 0,
|
|
1056
|
+
disabled: formDisabled,
|
|
1057
|
+
onChange: (event) => setDatabase(event.target.value)
|
|
1058
|
+
})]
|
|
1059
|
+
})
|
|
1060
|
+
]
|
|
1061
|
+
}),
|
|
1062
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1063
|
+
className: DataAgentWorkbench_module_css_default.actions,
|
|
1064
|
+
children: !connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1065
|
+
type: "button",
|
|
1066
|
+
className: DataAgentWorkbench_module_css_default.primary,
|
|
1067
|
+
disabled: busy || database === "" || !sqlite && host === "",
|
|
1068
|
+
onClick: () => {
|
|
1069
|
+
connect();
|
|
1070
|
+
},
|
|
1071
|
+
children: restoring ? t("state.reconnecting") : busy ? t("state.checking") : t("action.connect")
|
|
1072
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1073
|
+
type: "button",
|
|
1074
|
+
className: DataAgentWorkbench_module_css_default.ghost,
|
|
1075
|
+
disabled: busy,
|
|
1076
|
+
onClick: () => {
|
|
1077
|
+
disconnect();
|
|
1078
|
+
},
|
|
1079
|
+
children: t("action.disconnect")
|
|
1080
|
+
})
|
|
1081
|
+
}),
|
|
1082
|
+
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1083
|
+
className: DataAgentWorkbench_module_css_default.errorBar,
|
|
1084
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1085
|
+
className: DataAgentWorkbench_module_css_default.errorHead,
|
|
1086
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(AlertIcon, { className: DataAgentWorkbench_module_css_default.errorIcon }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("error.title") })]
|
|
1087
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1088
|
+
className: DataAgentWorkbench_module_css_default.errorText,
|
|
1089
|
+
children: error
|
|
1090
|
+
})]
|
|
1091
|
+
})
|
|
1092
|
+
]
|
|
1093
|
+
})
|
|
1012
1094
|
})
|
|
1013
1095
|
]
|
|
1014
1096
|
});
|
|
@@ -1021,6 +1103,8 @@ window.__ModuleLoader__.load({
|
|
|
1021
1103
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
|
1022
1104
|
const zh = {
|
|
1023
1105
|
"form.title": "数据库连接",
|
|
1106
|
+
"form.hero.title": "连接数据库",
|
|
1107
|
+
"form.hero.hint": "连接 MySQL / PostgreSQL / SQLite 等,开始与数据 Agent 对话",
|
|
1024
1108
|
"form.type": "数据库类型",
|
|
1025
1109
|
"type.mysql": "MySQL",
|
|
1026
1110
|
"type.postgres": "PostgreSQL",
|
|
@@ -1032,6 +1116,10 @@ window.__ModuleLoader__.load({
|
|
|
1032
1116
|
"form.port": "端口",
|
|
1033
1117
|
"form.user": "用户名",
|
|
1034
1118
|
"form.password": "密码",
|
|
1119
|
+
"form.rememberPassword": "记住密码",
|
|
1120
|
+
"form.rememberPassword.hint": "仅勾选后才会在本机保存密码",
|
|
1121
|
+
"form.readonly": "只读模式",
|
|
1122
|
+
"form.readonly.hint": "仅放行查询语句,拒绝增删改、建表等写操作",
|
|
1035
1123
|
"form.database": "数据库名",
|
|
1036
1124
|
"form.database.oracle": "服务名 / SID",
|
|
1037
1125
|
"form.database.hive": "默认库",
|
|
@@ -1060,12 +1148,13 @@ window.__ModuleLoader__.load({
|
|
|
1060
1148
|
"action.config": "连接配置",
|
|
1061
1149
|
"action.browse": "库表",
|
|
1062
1150
|
"action.close": "关闭",
|
|
1063
|
-
"action.collapse": "收起",
|
|
1064
1151
|
"error.title": "操作失败"
|
|
1065
1152
|
};
|
|
1066
1153
|
/** English dictionary, checked complete against the zh key set. */
|
|
1067
1154
|
const en = {
|
|
1068
1155
|
"form.title": "Database connection",
|
|
1156
|
+
"form.hero.title": "Connect database",
|
|
1157
|
+
"form.hero.hint": "Connect MySQL / PostgreSQL / SQLite and start chatting with the data agent",
|
|
1069
1158
|
"form.type": "Database type",
|
|
1070
1159
|
"type.mysql": "MySQL",
|
|
1071
1160
|
"type.postgres": "PostgreSQL",
|
|
@@ -1077,6 +1166,10 @@ window.__ModuleLoader__.load({
|
|
|
1077
1166
|
"form.port": "Port",
|
|
1078
1167
|
"form.user": "User",
|
|
1079
1168
|
"form.password": "Password",
|
|
1169
|
+
"form.rememberPassword": "Remember password",
|
|
1170
|
+
"form.rememberPassword.hint": "Saved locally only when checked",
|
|
1171
|
+
"form.readonly": "Read-only mode",
|
|
1172
|
+
"form.readonly.hint": "Allow read queries only; reject writes (INSERT/UPDATE/DELETE/DDL)",
|
|
1080
1173
|
"form.database": "Database",
|
|
1081
1174
|
"form.database.oracle": "Service name / SID",
|
|
1082
1175
|
"form.database.hive": "Default database",
|
|
@@ -1105,7 +1198,6 @@ window.__ModuleLoader__.load({
|
|
|
1105
1198
|
"action.config": "Connection settings",
|
|
1106
1199
|
"action.browse": "Tables",
|
|
1107
1200
|
"action.close": "Close",
|
|
1108
|
-
"action.collapse": "Collapse",
|
|
1109
1201
|
"error.title": "Operation failed"
|
|
1110
1202
|
};
|
|
1111
1203
|
//#endregion
|