@yejiming/dsh-data-agent 0.0.9 → 0.0.10
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 +31 -7
- package/README.md +31 -7
- package/cordis.patch.yml +8 -9
- package/lib/client.js +520 -578
- package/lib/client.js.map +1 -1
- package/lib/command-LFgLb6el.js +875 -0
- package/lib/command.js +1 -874
- package/lib/{connections-DeauhaZi.js → connections-WmjuUrDj.js} +300 -11
- package/lib/index.js +99 -36
- package/lib/tool-Dka6RyEp.js +1128 -0
- package/lib/tool.js +1 -1127
- package/lib/types/client/DataAgentWorkbench.d.ts +2 -2
- package/lib/types/client/index.d.ts +3 -4
- package/lib/types/client/locales.d.ts +18 -0
- package/lib/types/client-discovery.d.ts +45 -0
- package/lib/types/clients.d.ts +7 -1
- package/lib/types/defaults.d.ts +2 -0
- package/lib/types/index.d.ts +42 -16
- package/lib/types/routes.d.ts +0 -14
- package/lib/types/tool.d.ts +4 -0
- package/package.json +5 -1
- package/preset/data-agent/agent.cordis.yml +6 -25
- package/preset/data-agent/preset.yml +1 -1
package/lib/client.js
CHANGED
|
@@ -90,7 +90,7 @@ window.__ModuleLoader__.load({
|
|
|
90
90
|
}
|
|
91
91
|
//#endregion
|
|
92
92
|
//#region \0dsh-css:/Users/yejiming/Desktop/OpenSource/dsh-data-agent/src/client/DataAgentWorkbench.module.css.mjs
|
|
93
|
-
const css$1 = ".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,html.Sv3uVW_da-split [data-phase=active] [data-conversation-scroll]>[data-slot=conversation\\.session]>*{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}}";
|
|
93
|
+
const css$1 = ".Sv3uVW_triggerSlot{z-index:12;pointer-events:auto;display:flex;position:absolute;top:-42px;right:12px}.Sv3uVW_trigger{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-specific-selector,var(--dsw-alias-bg-layer-2,#ffffff0f));width:30px;height:30px;color:var(--dsw-alias-label-secondary,#808080e6);cursor:pointer;border-radius:9px;place-items:center;padding:0;transition:background-color .15s ease-out,border-color .15s ease-out,color .15s ease-out;display:grid;position:relative;box-shadow:0 1px 2px #0000000a}.Sv3uVW_trigger:hover,.Sv3uVW_triggerActive{border-color:var(--dsw-alias-border-l3,#80808080);background:var(--dsw-alias-interactive-bg-hover-solid,var(--dsw-alias-interactive-bg-hover,#8080801a));color:var(--dsw-alias-label-primary,inherit)}.Sv3uVW_trigger:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 25%, transparent);outline:none}.Sv3uVW_triggerDot{box-shadow:0 0 0 2px var(--dsw-specific-input-major,var(--dsw-alias-bg-base,#fff));border-radius:999px;position:absolute;bottom:-2px;right:-2px}.Sv3uVW_workbenchModal{width:min(920px,94vw)}.Sv3uVW_workbenchModalContent{min-height:min(590px,70vh);max-height:min(700px,76vh);overflow:auto}.Sv3uVW_workbench{box-sizing:border-box;min-height:520px;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:14px;font-size:13px;line-height:1.5;display:flex}.Sv3uVW_connectionSummary{border:1px solid var(--dsw-alias-border-l1,#80808033);background:var(--dsw-alias-bg-layer-2,#ffffff0a);border-radius:10px;align-items:center;gap:8px;min-height:34px;padding:6px 10px;display:flex}.Sv3uVW_connectionState{flex:none;font-size:12px;font-weight:600}.Sv3uVW_summaryType{border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-1,#ffffff08);color:var(--dsw-alias-label-secondary,#808080cc);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);border-radius:999px;flex:none;padding:2px 8px;font-size:11px}.Sv3uVW_summaryDb{min-width:0;color:var(--dsw-alias-label-secondary,#808080cc);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.Sv3uVW_tabs{background:var(--dsw-specific-selector,var(--dsw-alias-bg-layer-2,#80808014));border-radius:10px;align-items:center;gap:4px;padding:3px;display:flex;overflow-x:auto}.Sv3uVW_tab{height:34px;color:var(--dsw-alias-label-secondary,#808080cc);font:inherit;white-space:nowrap;cursor:pointer;background:0 0;border:none;border-radius:8px;flex:1 0 120px;justify-content:center;align-items:center;gap:7px;padding:0 14px;font-size:13px;font-weight:500;display:inline-flex}.Sv3uVW_tab:hover:not(:disabled){color:var(--dsw-alias-label-primary,inherit);background:var(--dsw-alias-interactive-bg-hover,#80808014)}.Sv3uVW_tabActive,.Sv3uVW_tabActive:hover:not(:disabled){color:var(--dsw-alias-label-primary,inherit);background:var(--dsw-specific-input-major,var(--dsw-alias-bg-layer-1,#fffc));box-shadow:var(--dsw-shadow-lv1,0 1px 3px #00000014)}.Sv3uVW_tab:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 28%, transparent);outline:none}.Sv3uVW_tab:disabled{opacity:.42;cursor:default}.Sv3uVW_tabPanel{flex-direction:column;flex:1;gap:14px;min-height:0;padding:2px;display:flex}.Sv3uVW_fieldGrid{flex-direction:column;gap:11px;display:flex}.Sv3uVW_fieldRow2{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;display:grid}.Sv3uVW_field{flex-direction:column;gap:5px;min-width:0;display:flex}.Sv3uVW_label{color:var(--dsw-alias-label-secondary,#808080bf);font-size:11px;font-weight:500}.Sv3uVW_rememberRow{color:var(--dsw-alias-label-primary,inherit);cursor:pointer;user-select:none;align-items:center;gap:7px;font-size:12px;display:flex}.Sv3uVW_rememberRow input[type=checkbox]{width:14px;height:14px;accent-color:var(--dsw-alias-button-info-fill,#3b82f6);flex:none;margin:0}.Sv3uVW_rememberHint{color:var(--dsw-alias-label-caption,#8080808c);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:34px;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,.Sv3uVW_input:focus-visible,.Sv3uVW_sqlInput:focus,.Sv3uVW_sqlInput: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_input:disabled{opacity:.58}select.Sv3uVW_input{appearance:none;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{justify-content:flex-end;align-items:center;gap:8px;margin-top:auto;padding-top:4px;display:flex}.Sv3uVW_primary,.Sv3uVW_ghost{min-width:96px;height:34px;font:inherit;cursor:pointer;border:1px solid #0000;border-radius:8px;justify-content:center;align-items:center;gap:6px;padding:0 15px;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_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_primary:focus-visible,.Sv3uVW_ghost:focus-visible,.Sv3uVW_treeItem:focus-visible{box-shadow:0 0 0 3px color-mix(in srgb, var(--dsw-alias-button-info-fill,#3b82f6) 24%, transparent);outline:none}.Sv3uVW_primary:disabled,.Sv3uVW_ghost:disabled{opacity:.45;cursor:default}.Sv3uVW_schemaPanel{grid-template-columns:minmax(260px,.9fr) minmax(320px,1.1fr);gap:20px;height:min(470px,56vh);display:grid}.Sv3uVW_modalCol{flex-direction:column;gap:8px;min-width:0;min-height:0;display:flex}.Sv3uVW_modalColTitle{color:var(--dsw-alias-label-tertiary,#808080b3);letter-spacing:.06em;text-transform:uppercase;flex:none;align-items:center;gap:6px;font-size:11px;font-weight:600;display:flex}.Sv3uVW_colCount,.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: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,.Sv3uVW_treeChildren{flex-direction:column;gap:1px;display:flex}.Sv3uVW_treeItem{width:100%;min-height:30px;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{color:var(--dsw-alias-label-tertiary,#80808099);flex:none;transition:transform .15s ease-out}.Sv3uVW_treeChevron.Sv3uVW_open{transform:rotate(90deg)}.Sv3uVW_treeIcon{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{min-width:0;font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;overflow:hidden}.Sv3uVW_treeChildren{border-left:1px solid var(--dsw-alias-border-l2,#80808059);max-height:154px;margin-left:12px;padding-left:10px;overflow-y:auto}.Sv3uVW_hint{color:var(--dsw-alias-label-tertiary,#80808099);font-size:12px}.Sv3uVW_modalHint{color:var(--dsw-alias-label-caption,#80808080);flex:none;margin-top:2px;font-size:11.5px}.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;border-bottom:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);color:var(--dsw-alias-label-tertiary,#808080b3);letter-spacing:.05em;text-align:left;text-transform:uppercase;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);padding:6px 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_sqlPanel{min-height:430px}.Sv3uVW_sqlInput{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l2,#80808059);background:var(--dsw-alias-bg-layer-2,#ffffff0a);width:100%;min-height:210px;color:var(--dsw-alias-label-primary,inherit);font-family:var(--ds-font-family-code,ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);border-radius:10px;padding:12px;font-size:12.5px;line-height:1.6}.Sv3uVW_sqlInput::placeholder{color:var(--dsw-alias-label-caption,#80808080)}.Sv3uVW_sqlActions{justify-content:flex-end;align-items:center;gap:10px;display:flex}.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);min-height:100px;max-height:220px;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;flex:1;margin:0;padding:11px 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}.Sv3uVW_errorText{white-space:pre-wrap;word-break:break-word;font-size:12px}@media (width<=640px){.Sv3uVW_triggerSlot{top:-42px;right:10px}.Sv3uVW_workbenchModal{width:min(96vw,920px)}.Sv3uVW_workbenchModalContent{min-height:0;max-height:72vh}.Sv3uVW_workbench{min-height:0}.Sv3uVW_fieldRow2{grid-template-columns:1fr}.Sv3uVW_schemaPanel{flex-direction:column;height:auto;display:flex}.Sv3uVW_treeScroll{flex:none;height:240px}.Sv3uVW_colScroll{flex:none;height:220px}.Sv3uVW_emptyState{flex:none;min-height:120px}.Sv3uVW_rememberRow{flex-wrap:wrap;align-items:flex-start}.Sv3uVW_rememberHint{flex-basis:100%;padding-left:21px}}@media (prefers-reduced-motion:reduce){.Sv3uVW_trigger,.Sv3uVW_input,.Sv3uVW_primary,.Sv3uVW_ghost,.Sv3uVW_treeChevron{transition:none}}";
|
|
94
94
|
const tagId$1 = "@yejiming/dsh-data-agent/DataAgentWorkbench.module.css";
|
|
95
95
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
|
96
96
|
const tag = document.createElement("style");
|
|
@@ -100,104 +100,78 @@ window.__ModuleLoader__.load({
|
|
|
100
100
|
document.head.appendChild(tag);
|
|
101
101
|
}
|
|
102
102
|
var DataAgentWorkbench_module_css_default = {
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
103
|
+
"errorText": "Sv3uVW_errorText",
|
|
104
|
+
"tabPanel": "Sv3uVW_tabPanel",
|
|
105
|
+
"tabs": "Sv3uVW_tabs",
|
|
106
|
+
"modalColTitle": "Sv3uVW_modalColTitle",
|
|
107
|
+
"errorHead": "Sv3uVW_errorHead",
|
|
108
|
+
"input": "Sv3uVW_input",
|
|
109
|
+
"treeNode": "Sv3uVW_treeNode",
|
|
110
|
+
"hint": "Sv3uVW_hint",
|
|
111
|
+
"triggerDot": "Sv3uVW_triggerDot",
|
|
108
112
|
"tree": "Sv3uVW_tree",
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
113
|
+
"nullCell": "Sv3uVW_nullCell",
|
|
114
|
+
"fieldGrid": "Sv3uVW_fieldGrid",
|
|
115
|
+
"modalCol": "Sv3uVW_modalCol",
|
|
116
|
+
"rememberRow": "Sv3uVW_rememberRow",
|
|
112
117
|
"label": "Sv3uVW_label",
|
|
113
|
-
"
|
|
114
|
-
"sqlInput": "Sv3uVW_sqlInput",
|
|
115
|
-
"shortcutHint": "Sv3uVW_shortcutHint",
|
|
116
|
-
"summaryDb": "Sv3uVW_summaryDb",
|
|
117
|
-
"treeCount": "Sv3uVW_treeCount",
|
|
118
|
+
"summaryType": "Sv3uVW_summaryType",
|
|
118
119
|
"treeChildren": "Sv3uVW_treeChildren",
|
|
120
|
+
"sqlInput": "Sv3uVW_sqlInput",
|
|
121
|
+
"tabActive": "Sv3uVW_tabActive",
|
|
122
|
+
"primary": "Sv3uVW_primary",
|
|
123
|
+
"emptyStateIcon": "Sv3uVW_emptyStateIcon",
|
|
124
|
+
"treeIcon": "Sv3uVW_treeIcon",
|
|
125
|
+
"open": "Sv3uVW_open",
|
|
126
|
+
"fieldRow2": "Sv3uVW_fieldRow2",
|
|
127
|
+
"errorIcon": "Sv3uVW_errorIcon",
|
|
128
|
+
"modalHint": "Sv3uVW_modalHint",
|
|
129
|
+
"connectionState": "Sv3uVW_connectionState",
|
|
130
|
+
"columnsTable": "Sv3uVW_columnsTable",
|
|
119
131
|
"active": "Sv3uVW_active",
|
|
120
|
-
"nullCell": "Sv3uVW_nullCell",
|
|
121
132
|
"colCount": "Sv3uVW_colCount",
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
133
|
+
"sqlResult": "Sv3uVW_sqlResult",
|
|
134
|
+
"treeCount": "Sv3uVW_treeCount",
|
|
135
|
+
"sqlPanel": "Sv3uVW_sqlPanel",
|
|
136
|
+
"tab": "Sv3uVW_tab",
|
|
137
|
+
"connectionSummary": "Sv3uVW_connectionSummary",
|
|
138
|
+
"typeCell": "Sv3uVW_typeCell",
|
|
126
139
|
"treeScroll": "Sv3uVW_treeScroll",
|
|
127
140
|
"emptyStateText": "Sv3uVW_emptyStateText",
|
|
128
|
-
"
|
|
129
|
-
"input": "Sv3uVW_input",
|
|
130
|
-
"treeItem": "Sv3uVW_treeItem",
|
|
131
|
-
"treeIcon": "Sv3uVW_treeIcon",
|
|
132
|
-
"treeName": "Sv3uVW_treeName",
|
|
133
|
-
"heroConnect": "Sv3uVW_heroConnect",
|
|
134
|
-
"modalCol": "Sv3uVW_modalCol",
|
|
135
|
-
"ghost": "Sv3uVW_ghost",
|
|
136
|
-
"errorIcon": "Sv3uVW_errorIcon",
|
|
137
|
-
"da-split": "Sv3uVW_da-split",
|
|
138
|
-
"small": "Sv3uVW_small",
|
|
139
|
-
"statusOk": "Sv3uVW_statusOk",
|
|
140
|
-
"docked": "Sv3uVW_docked",
|
|
141
|
-
"cardTitle": "Sv3uVW_cardTitle",
|
|
142
|
-
"titleIcon": "Sv3uVW_titleIcon",
|
|
143
|
-
"connectModal": "Sv3uVW_connectModal",
|
|
144
|
-
"heroHint": "Sv3uVW_heroHint",
|
|
145
|
-
"summaryRow": "Sv3uVW_summaryRow",
|
|
146
|
-
"rememberRow": "Sv3uVW_rememberRow",
|
|
141
|
+
"workbench": "Sv3uVW_workbench",
|
|
147
142
|
"errorBar": "Sv3uVW_errorBar",
|
|
148
|
-
"
|
|
143
|
+
"treeItem": "Sv3uVW_treeItem",
|
|
149
144
|
"actions": "Sv3uVW_actions",
|
|
150
|
-
"
|
|
151
|
-
"sqlResult": "Sv3uVW_sqlResult",
|
|
152
|
-
"open": "Sv3uVW_open",
|
|
145
|
+
"rememberHint": "Sv3uVW_rememberHint",
|
|
153
146
|
"colScroll": "Sv3uVW_colScroll",
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"fieldRow2": "Sv3uVW_fieldRow2",
|
|
157
|
-
"emptyStateIcon": "Sv3uVW_emptyStateIcon",
|
|
158
|
-
"errorText": "Sv3uVW_errorText",
|
|
159
|
-
"heroChevron": "Sv3uVW_heroChevron",
|
|
160
|
-
"card": "Sv3uVW_card",
|
|
161
|
-
"workbench": "Sv3uVW_workbench",
|
|
162
|
-
"primary": "Sv3uVW_primary",
|
|
163
|
-
"field": "Sv3uVW_field",
|
|
147
|
+
"workbenchModal": "Sv3uVW_workbenchModal",
|
|
148
|
+
"sqlActions": "Sv3uVW_sqlActions",
|
|
164
149
|
"emptyState": "Sv3uVW_emptyState",
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
150
|
+
"shortcutHint": "Sv3uVW_shortcutHint",
|
|
151
|
+
"treeChevron": "Sv3uVW_treeChevron",
|
|
152
|
+
"schemaPanel": "Sv3uVW_schemaPanel",
|
|
153
|
+
"triggerSlot": "Sv3uVW_triggerSlot",
|
|
154
|
+
"ghost": "Sv3uVW_ghost",
|
|
155
|
+
"trigger": "Sv3uVW_trigger",
|
|
156
|
+
"workbenchModalContent": "Sv3uVW_workbenchModalContent",
|
|
157
|
+
"treeName": "Sv3uVW_treeName",
|
|
158
|
+
"summaryDb": "Sv3uVW_summaryDb",
|
|
159
|
+
"triggerActive": "Sv3uVW_triggerActive",
|
|
160
|
+
"field": "Sv3uVW_field"
|
|
172
161
|
};
|
|
173
162
|
//#endregion
|
|
174
163
|
//#region src/client/DataAgentWorkbench.tsx
|
|
175
164
|
/**
|
|
176
|
-
* The database workbench
|
|
177
|
-
* a browse button that opens the schema explorer Modal, and the SQL command
|
|
178
|
-
* box, rendered into the composer input dock (the strip ABOVE the input bar)
|
|
179
|
-
* for data-agent sessions.
|
|
180
|
-
*
|
|
181
|
-
* Layout is phase-driven by the conversation root's `data-phase` attribute:
|
|
182
|
-
* - hero (blank session): the workbench is a full-width stacked strip above
|
|
183
|
-
* the input bar (which stays at the bottom);
|
|
184
|
-
* - active (conversation started): the workbench becomes a fixed left rail
|
|
185
|
-
* (measured from the conversation column), the chat records and the input
|
|
186
|
-
* bar shift right via the `da-split` CSS rules; if measurement is
|
|
187
|
-
* unavailable the workbench falls back to a docked bottom panel.
|
|
165
|
+
* The database workbench entry for data-agent sessions.
|
|
188
166
|
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* file-explorer style tree (folder rows with chevrons, indented table rows
|
|
195
|
-
* with guide lines, the whole tree scrolls inside the column);
|
|
196
|
-
* - clicking a table loads its columns into the Modal's structure panel.
|
|
167
|
+
* Only a compact database button remains mounted from the composer slot and
|
|
168
|
+
* is visually lifted into the context row above the composer card.
|
|
169
|
+
* Clicking it opens one Modal containing connection settings, the schema
|
|
170
|
+
* explorer, and SQL runner as three tabs. Hero and active conversations share
|
|
171
|
+
* this exact surface; the plugin never measures or shifts host layout.
|
|
197
172
|
*
|
|
198
|
-
* Non-data-agent sessions render null
|
|
199
|
-
* Connection state lives on the server
|
|
200
|
-
* remounts never lose it — this component mirrors `/status` on mount.
|
|
173
|
+
* Non-data-agent sessions render null before any effect or request runs.
|
|
174
|
+
* Connection state lives on the server and is mirrored from `/status`.
|
|
201
175
|
*/
|
|
202
176
|
/** The plugin's preset id, matching the installed agent preset directory. */
|
|
203
177
|
const DATA_AGENT_PRESET = "data-agent";
|
|
@@ -364,15 +338,6 @@ window.__ModuleLoader__.load({
|
|
|
364
338
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M3.4 2.1C3.4 1.66 3.88 1.4 4.26 1.62L9.9 5.02C10.26 5.23 10.26 5.77 9.9 5.98L4.26 9.38C3.88 9.6 3.4 9.34 3.4 8.9V2.1Z" })
|
|
365
339
|
});
|
|
366
340
|
}
|
|
367
|
-
/** The conversation column's phase attribute value while the session is blank. */
|
|
368
|
-
function isHeroPhase(element) {
|
|
369
|
-
return element?.getAttribute("data-phase") === "hero";
|
|
370
|
-
}
|
|
371
|
-
/**
|
|
372
|
-
* 开始对话后(active 布局)左栏工作台相对会话列顶部的下移偏移(px):
|
|
373
|
-
* 让工作台避开会话头部区域、整体往下沉一些,顶部露出对话记录。
|
|
374
|
-
*/
|
|
375
|
-
const RAIL_TOP_OFFSET = 96;
|
|
376
341
|
/** Default port per type (used to fill the form from a saved connection). */
|
|
377
342
|
function defaultPortOf(type) {
|
|
378
343
|
switch (type) {
|
|
@@ -429,9 +394,7 @@ window.__ModuleLoader__.load({
|
|
|
429
394
|
/** The database workbench body. */
|
|
430
395
|
function DataAgentWorkbench({ sessionId, useSessions, t }) {
|
|
431
396
|
const isDataAgent = useSessions((snapshot) => snapshot).byId[sessionId]?.agentPreset === DATA_AGENT_PRESET;
|
|
432
|
-
const
|
|
433
|
-
const [phase, setPhase] = (0, react.useState)("hero");
|
|
434
|
-
const [railRect, setRailRect] = (0, react.useState)(null);
|
|
397
|
+
const tabsId = (0, react.useId)();
|
|
435
398
|
const [initialSaved] = (0, react.useState)(loadConnection);
|
|
436
399
|
const [type, setType] = (0, react.useState)(initialSaved?.type ?? "mysql");
|
|
437
400
|
const [host, setHost] = (0, react.useState)(initialSaved?.host ?? "127.0.0.1");
|
|
@@ -447,10 +410,12 @@ window.__ModuleLoader__.load({
|
|
|
447
410
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
448
411
|
const [error, setError] = (0, react.useState)(null);
|
|
449
412
|
const [connected, setConnected] = (0, react.useState)(false);
|
|
450
|
-
const [
|
|
413
|
+
const [workbenchOpen, setWorkbenchOpen] = (0, react.useState)(false);
|
|
414
|
+
const [activeTab, setActiveTab] = (0, react.useState)("connection");
|
|
451
415
|
const [restoring, setRestoring] = (0, react.useState)(false);
|
|
452
|
-
const [schemaModalOpen, setSchemaModalOpen] = (0, react.useState)(false);
|
|
453
416
|
const [schemas, setSchemas] = (0, react.useState)([]);
|
|
417
|
+
const schemasLoaded = (0, react.useRef)(false);
|
|
418
|
+
const [schemaBusy, setSchemaBusy] = (0, react.useState)(false);
|
|
454
419
|
const [activeSchema, setActiveSchema] = (0, react.useState)(null);
|
|
455
420
|
const [tables, setTables] = (0, react.useState)([]);
|
|
456
421
|
const [activeTable, setActiveTable] = (0, react.useState)(null);
|
|
@@ -458,67 +423,10 @@ window.__ModuleLoader__.load({
|
|
|
458
423
|
const [sql, setSql] = (0, react.useState)("");
|
|
459
424
|
const [sqlBusy, setSqlBusy] = (0, react.useState)(false);
|
|
460
425
|
const [sqlResult, setSqlResult] = (0, react.useState)(null);
|
|
461
|
-
(0, react.
|
|
462
|
-
let column = rootRef.current?.closest("[data-phase]") ?? null;
|
|
463
|
-
const refreshPhase = () => {
|
|
464
|
-
if (column !== null) setPhase((prev) => {
|
|
465
|
-
const next = isHeroPhase(column) ? "hero" : "active";
|
|
466
|
-
return next === prev ? prev : next;
|
|
467
|
-
});
|
|
468
|
-
};
|
|
469
|
-
const measure = () => {
|
|
470
|
-
if (column !== null) {
|
|
471
|
-
const rect = column.getBoundingClientRect();
|
|
472
|
-
const bottom = window.innerHeight - rect.bottom;
|
|
473
|
-
setRailRect((prev) => prev !== null && prev.left === rect.left && prev.top === rect.top && prev.bottom === bottom ? prev : {
|
|
474
|
-
left: rect.left,
|
|
475
|
-
top: rect.top,
|
|
476
|
-
bottom
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
};
|
|
480
|
-
const observer = new MutationObserver(refreshPhase);
|
|
481
|
-
const resizer = new ResizeObserver(measure);
|
|
482
|
-
const sync = () => {
|
|
483
|
-
const next = rootRef.current?.closest("[data-phase]") ?? null;
|
|
484
|
-
if (next !== null) {
|
|
485
|
-
if (next !== column) {
|
|
486
|
-
observer.disconnect();
|
|
487
|
-
resizer.disconnect();
|
|
488
|
-
column = next;
|
|
489
|
-
observer.observe(column, {
|
|
490
|
-
attributes: true,
|
|
491
|
-
attributeFilter: ["data-phase"]
|
|
492
|
-
});
|
|
493
|
-
resizer.observe(column);
|
|
494
|
-
}
|
|
495
|
-
refreshPhase();
|
|
496
|
-
measure();
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
sync();
|
|
500
|
-
window.addEventListener("resize", measure);
|
|
501
|
-
const poll = window.setInterval(sync, 1e3);
|
|
502
|
-
return () => {
|
|
503
|
-
window.clearInterval(poll);
|
|
504
|
-
if (column !== null) resizer.unobserve(column);
|
|
505
|
-
observer.disconnect();
|
|
506
|
-
resizer.disconnect();
|
|
507
|
-
window.removeEventListener("resize", measure);
|
|
508
|
-
};
|
|
509
|
-
}, [isDataAgent]);
|
|
510
|
-
const split = phase === "active" && railRect !== null;
|
|
511
|
-
(0, react.useLayoutEffect)(() => {
|
|
512
|
-
const root = document.documentElement;
|
|
513
|
-
const splitClass = DataAgentWorkbench_module_css_default["da-split"];
|
|
514
|
-
if (split && splitClass !== void 0) root.classList.add(splitClass);
|
|
515
|
-
else if (splitClass !== void 0) root.classList.remove(splitClass);
|
|
516
|
-
return () => {
|
|
517
|
-
if (splitClass !== void 0) root.classList.remove(splitClass);
|
|
518
|
-
};
|
|
519
|
-
}, [split]);
|
|
426
|
+
const triggerSlotRef = (0, react.useRef)(null);
|
|
520
427
|
const firstDraftRun = (0, react.useRef)(true);
|
|
521
428
|
(0, react.useEffect)(() => {
|
|
429
|
+
if (!isDataAgent) return;
|
|
522
430
|
if (firstDraftRun.current) {
|
|
523
431
|
firstDraftRun.current = false;
|
|
524
432
|
return;
|
|
@@ -539,6 +447,7 @@ window.__ModuleLoader__.load({
|
|
|
539
447
|
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
540
448
|
});
|
|
541
449
|
}, [
|
|
450
|
+
isDataAgent,
|
|
542
451
|
type,
|
|
543
452
|
host,
|
|
544
453
|
port,
|
|
@@ -551,6 +460,7 @@ window.__ModuleLoader__.load({
|
|
|
551
460
|
readonly
|
|
552
461
|
]);
|
|
553
462
|
(0, react.useEffect)(() => {
|
|
463
|
+
if (!isDataAgent) return;
|
|
554
464
|
let cancelled = false;
|
|
555
465
|
const controller = new AbortController();
|
|
556
466
|
const saved = initialSaved;
|
|
@@ -570,8 +480,6 @@ window.__ModuleLoader__.load({
|
|
|
570
480
|
if (body.summary.passwordRef !== void 0) setCredentialMode("reference");
|
|
571
481
|
setCredentialStatus(body.summary.credential);
|
|
572
482
|
}
|
|
573
|
-
const schemasBody = await parseJsonResponse(await fetch(`/plugins/data-agent/schemas?sessionId=${encodeURIComponent(sessionId)}`, { signal: controller.signal }));
|
|
574
|
-
if (!cancelled && schemasBody.ok) setSchemas(schemasBody.schemas ?? []);
|
|
575
483
|
return;
|
|
576
484
|
}
|
|
577
485
|
if (saved !== null && saved.database !== "") {
|
|
@@ -582,9 +490,6 @@ window.__ModuleLoader__.load({
|
|
|
582
490
|
if (result.ok) {
|
|
583
491
|
setConnected(true);
|
|
584
492
|
setCredentialStatus(result.summary?.credential);
|
|
585
|
-
setConnectModalOpen(false);
|
|
586
|
-
const schemasBody = await parseJsonResponse(await fetch(`/plugins/data-agent/schemas?sessionId=${encodeURIComponent(sessionId)}`, { signal: controller.signal }));
|
|
587
|
-
if (!cancelled && schemasBody.ok) setSchemas(schemasBody.schemas ?? []);
|
|
588
493
|
} else setError(`连接恢复失败:${result.error ?? "unknown error"}`);
|
|
589
494
|
} catch (cause) {
|
|
590
495
|
if (!cancelled) setError(`连接恢复失败:${cause instanceof Error ? cause.message : String(cause)}`);
|
|
@@ -599,8 +504,29 @@ window.__ModuleLoader__.load({
|
|
|
599
504
|
cancelled = true;
|
|
600
505
|
controller.abort();
|
|
601
506
|
};
|
|
602
|
-
}, [
|
|
507
|
+
}, [
|
|
508
|
+
initialSaved,
|
|
509
|
+
isDataAgent,
|
|
510
|
+
sessionId
|
|
511
|
+
]);
|
|
603
512
|
const sqlite = type === "sqlite";
|
|
513
|
+
/** Load schemas on first entry to the schema tab; cache successful empty results too. */
|
|
514
|
+
const loadSchemas = async (force = false) => {
|
|
515
|
+
if (schemaBusy || schemasLoaded.current && !force) return;
|
|
516
|
+
setSchemaBusy(true);
|
|
517
|
+
setError(null);
|
|
518
|
+
try {
|
|
519
|
+
const result = await parseJsonResponse(await fetch(`/plugins/data-agent/schemas?sessionId=${encodeURIComponent(sessionId)}`));
|
|
520
|
+
if (result.ok) {
|
|
521
|
+
setSchemas(result.schemas ?? []);
|
|
522
|
+
schemasLoaded.current = true;
|
|
523
|
+
} else setError(result.error ?? "unknown error");
|
|
524
|
+
} catch (cause) {
|
|
525
|
+
setError(cause instanceof Error ? cause.message : String(cause));
|
|
526
|
+
} finally {
|
|
527
|
+
setSchemaBusy(false);
|
|
528
|
+
}
|
|
529
|
+
};
|
|
604
530
|
const connect = async () => {
|
|
605
531
|
setBusy(true);
|
|
606
532
|
setError(null);
|
|
@@ -624,9 +550,9 @@ window.__ModuleLoader__.load({
|
|
|
624
550
|
if (result.ok) {
|
|
625
551
|
setConnected(true);
|
|
626
552
|
setCredentialStatus(result.summary?.credential);
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
553
|
+
setActiveTab("schema");
|
|
554
|
+
schemasLoaded.current = false;
|
|
555
|
+
await loadSchemas(true);
|
|
630
556
|
} else setError(result.error ?? "unknown error");
|
|
631
557
|
} catch (cause) {
|
|
632
558
|
setError(cause instanceof Error ? cause.message : String(cause));
|
|
@@ -646,8 +572,9 @@ window.__ModuleLoader__.load({
|
|
|
646
572
|
setConnected(false);
|
|
647
573
|
setCredentialStatus(void 0);
|
|
648
574
|
setReadonly(false);
|
|
649
|
-
|
|
575
|
+
setActiveTab("connection");
|
|
650
576
|
setSchemas([]);
|
|
577
|
+
schemasLoaded.current = false;
|
|
651
578
|
setActiveSchema(null);
|
|
652
579
|
setTables([]);
|
|
653
580
|
setActiveTable(null);
|
|
@@ -723,168 +650,354 @@ window.__ModuleLoader__.load({
|
|
|
723
650
|
setSqlBusy(false);
|
|
724
651
|
}
|
|
725
652
|
};
|
|
653
|
+
const composerPlaceholder = connected ? t("composer.placeholder.connected") : t("composer.placeholder.disconnected");
|
|
654
|
+
(0, react.useLayoutEffect)(() => {
|
|
655
|
+
if (!isDataAgent) return;
|
|
656
|
+
const textarea = (triggerSlotRef.current?.closest("[data-composer-card]"))?.querySelector("textarea");
|
|
657
|
+
if (textarea === void 0 || textarea === null || textarea.disabled) return;
|
|
658
|
+
const hostPlaceholder = textarea.getAttribute("placeholder");
|
|
659
|
+
textarea.setAttribute("placeholder", composerPlaceholder);
|
|
660
|
+
return () => {
|
|
661
|
+
if (textarea.getAttribute("placeholder") !== composerPlaceholder) return;
|
|
662
|
+
if (hostPlaceholder === null) textarea.removeAttribute("placeholder");
|
|
663
|
+
else textarea.setAttribute("placeholder", hostPlaceholder);
|
|
664
|
+
};
|
|
665
|
+
});
|
|
726
666
|
if (!isDataAgent) return null;
|
|
727
667
|
const databaseLabel = sqlite ? t("form.database.sqlite") : type === "oracle" ? t("form.database.oracle") : type === "hive" || type === "impala" ? t("form.database.hive") : t("form.database");
|
|
728
|
-
const railStyle = split ? {
|
|
729
|
-
position: "fixed",
|
|
730
|
-
left: railRect.left,
|
|
731
|
-
top: railRect.top + RAIL_TOP_OFFSET,
|
|
732
|
-
bottom: railRect.bottom,
|
|
733
|
-
width: 380
|
|
734
|
-
} : void 0;
|
|
735
668
|
const formDisabled = busy || connected;
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
669
|
+
const triggerState = error !== null ? "error" : busy || restoring ? "ongoing" : connected ? "done" : "warning";
|
|
670
|
+
const triggerLabel = error !== null ? t("workbench.open.error") : busy || restoring ? t("workbench.open.checking") : connected ? t("workbench.open.connected") : t("workbench.open.disconnected");
|
|
671
|
+
const tabs = [
|
|
672
|
+
{
|
|
673
|
+
id: "connection",
|
|
674
|
+
label: t("action.config"),
|
|
675
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DatabaseIcon, {})
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
id: "schema",
|
|
679
|
+
label: t("action.browse"),
|
|
680
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableIcon, {})
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
id: "sql",
|
|
684
|
+
label: t("wb.sql"),
|
|
685
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TerminalIcon, {})
|
|
686
|
+
}
|
|
687
|
+
];
|
|
688
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
689
|
+
ref: triggerSlotRef,
|
|
690
|
+
className: DataAgentWorkbench_module_css_default.triggerSlot,
|
|
691
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
|
692
|
+
label: triggerLabel,
|
|
693
|
+
side: "top",
|
|
694
|
+
delayMs: 400,
|
|
695
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
696
|
+
type: "button",
|
|
697
|
+
className: `${DataAgentWorkbench_module_css_default.trigger}${workbenchOpen ? ` ${DataAgentWorkbench_module_css_default.triggerActive}` : ""}`,
|
|
698
|
+
"aria-label": triggerLabel,
|
|
699
|
+
"aria-haspopup": "dialog",
|
|
700
|
+
"aria-expanded": workbenchOpen,
|
|
701
|
+
onClick: () => setWorkbenchOpen(true),
|
|
702
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDataOutline16, { size: 17 }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
703
|
+
state: triggerState,
|
|
704
|
+
size: 7,
|
|
705
|
+
className: DataAgentWorkbench_module_css_default.triggerDot
|
|
706
|
+
})]
|
|
707
|
+
})
|
|
708
|
+
})
|
|
709
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Modal, {
|
|
710
|
+
open: workbenchOpen,
|
|
711
|
+
onClose: () => setWorkbenchOpen(false),
|
|
712
|
+
title: t("wb.workbench.title"),
|
|
713
|
+
description: t("wb.workbench.description"),
|
|
714
|
+
closeLabel: t("action.close"),
|
|
715
|
+
className: DataAgentWorkbench_module_css_default.workbenchModal,
|
|
716
|
+
contentClassName: DataAgentWorkbench_module_css_default.workbenchModalContent,
|
|
717
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
718
|
+
className: DataAgentWorkbench_module_css_default.workbench,
|
|
719
|
+
children: [
|
|
720
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
721
|
+
className: DataAgentWorkbench_module_css_default.connectionSummary,
|
|
722
|
+
role: "status",
|
|
723
|
+
children: [
|
|
724
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
725
|
+
state: triggerState,
|
|
726
|
+
size: 8
|
|
727
|
+
}),
|
|
728
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
729
|
+
className: DataAgentWorkbench_module_css_default.connectionState,
|
|
730
|
+
children: error !== null ? t("error.title") : restoring ? t("state.reconnecting") : busy ? t("state.checking") : connected ? t("state.connected") : t("state.disconnected")
|
|
731
|
+
}),
|
|
732
|
+
connected && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
733
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
734
|
+
className: DataAgentWorkbench_module_css_default.summaryType,
|
|
735
|
+
children: t(`type.${type}`)
|
|
736
|
+
}),
|
|
737
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
738
|
+
className: DataAgentWorkbench_module_css_default.summaryDb,
|
|
739
|
+
title: database,
|
|
740
|
+
children: database
|
|
741
|
+
}),
|
|
742
|
+
credentialStatus !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
743
|
+
className: DataAgentWorkbench_module_css_default.summaryType,
|
|
744
|
+
title: credentialStatus.source,
|
|
745
|
+
children: credentialStatus.configured ? t("credential.configured") : t("credential.unconfigured")
|
|
746
|
+
})
|
|
747
|
+
] })
|
|
748
|
+
]
|
|
749
|
+
}),
|
|
750
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
751
|
+
className: DataAgentWorkbench_module_css_default.tabs,
|
|
752
|
+
role: "tablist",
|
|
753
|
+
"aria-label": t("wb.workbench.tabs"),
|
|
754
|
+
children: tabs.map((tab) => {
|
|
755
|
+
const disabled = tab.id !== "connection" && !connected;
|
|
756
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
757
|
+
id: `${tabsId}-${tab.id}-tab`,
|
|
794
758
|
type: "button",
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
759
|
+
role: "tab",
|
|
760
|
+
className: `${DataAgentWorkbench_module_css_default.tab}${activeTab === tab.id ? ` ${DataAgentWorkbench_module_css_default.tabActive}` : ""}`,
|
|
761
|
+
"aria-selected": activeTab === tab.id,
|
|
762
|
+
"aria-controls": `${tabsId}-${tab.id}-panel`,
|
|
763
|
+
disabled,
|
|
764
|
+
onClick: () => {
|
|
765
|
+
setActiveTab(tab.id);
|
|
766
|
+
if (tab.id === "schema") loadSchemas();
|
|
767
|
+
},
|
|
768
|
+
children: [tab.icon, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tab.label })]
|
|
769
|
+
}, tab.id);
|
|
770
|
+
})
|
|
771
|
+
}),
|
|
772
|
+
activeTab === "connection" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
773
|
+
id: `${tabsId}-connection-panel`,
|
|
774
|
+
role: "tabpanel",
|
|
775
|
+
"aria-labelledby": `${tabsId}-connection-tab`,
|
|
776
|
+
className: DataAgentWorkbench_module_css_default.tabPanel,
|
|
777
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
778
|
+
className: DataAgentWorkbench_module_css_default.fieldGrid,
|
|
779
|
+
children: [
|
|
780
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
781
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
782
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
783
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
784
|
+
children: t("form.type")
|
|
785
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
786
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
787
|
+
value: type,
|
|
788
|
+
disabled: formDisabled,
|
|
789
|
+
onChange: (event) => {
|
|
790
|
+
const next = event.target.value;
|
|
791
|
+
setType(next);
|
|
792
|
+
setPort(next === "postgres" ? "5432" : next === "mysql" ? "3306" : next === "oracle" ? "1521" : next === "hive" ? "10000" : next === "impala" ? "21050" : "");
|
|
793
|
+
},
|
|
794
|
+
children: [
|
|
795
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
796
|
+
value: "mysql",
|
|
797
|
+
children: t("type.mysql")
|
|
798
|
+
}),
|
|
799
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
800
|
+
value: "postgres",
|
|
801
|
+
children: t("type.postgres")
|
|
802
|
+
}),
|
|
803
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
804
|
+
value: "sqlite",
|
|
805
|
+
children: t("type.sqlite")
|
|
806
|
+
}),
|
|
807
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
808
|
+
value: "oracle",
|
|
809
|
+
children: t("type.oracle")
|
|
810
|
+
}),
|
|
811
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
812
|
+
value: "hive",
|
|
813
|
+
children: t("type.hive")
|
|
814
|
+
}),
|
|
815
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
816
|
+
value: "impala",
|
|
817
|
+
children: t("type.impala")
|
|
818
|
+
})
|
|
819
|
+
]
|
|
820
|
+
})]
|
|
821
|
+
}),
|
|
822
|
+
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
823
|
+
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
824
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
825
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
826
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
827
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
828
|
+
children: t("form.host")
|
|
829
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
830
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
831
|
+
type: "text",
|
|
832
|
+
value: host,
|
|
833
|
+
disabled: formDisabled,
|
|
834
|
+
onChange: (event) => setHost(event.target.value)
|
|
835
|
+
})]
|
|
836
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
837
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
801
838
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
802
|
-
className: DataAgentWorkbench_module_css_default.
|
|
803
|
-
children: t("form.
|
|
804
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
805
|
-
className: DataAgentWorkbench_module_css_default.
|
|
806
|
-
|
|
839
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
840
|
+
children: t("form.port")
|
|
841
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
842
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
843
|
+
type: "number",
|
|
844
|
+
min: 1,
|
|
845
|
+
max: 65535,
|
|
846
|
+
value: port,
|
|
847
|
+
disabled: formDisabled,
|
|
848
|
+
onChange: (event) => setPort(event.target.value)
|
|
807
849
|
})]
|
|
808
|
-
})
|
|
809
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronIcon, { className: DataAgentWorkbench_module_css_default.heroChevron })
|
|
810
|
-
]
|
|
811
|
-
})
|
|
812
|
-
}),
|
|
813
|
-
connected && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
814
|
-
className: DataAgentWorkbench_module_css_default.card,
|
|
815
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
816
|
-
type: "button",
|
|
817
|
-
className: DataAgentWorkbench_module_css_default.browseRow,
|
|
818
|
-
onClick: () => setSchemaModalOpen(true),
|
|
819
|
-
children: [
|
|
820
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TableIcon, { className: DataAgentWorkbench_module_css_default.browseIcon }),
|
|
821
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("action.browse") }),
|
|
822
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChevronIcon, { className: DataAgentWorkbench_module_css_default.browseChevron })
|
|
823
|
-
]
|
|
824
|
-
})
|
|
825
|
-
}),
|
|
826
|
-
connected && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
827
|
-
className: DataAgentWorkbench_module_css_default.card,
|
|
828
|
-
children: [
|
|
829
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
830
|
-
className: DataAgentWorkbench_module_css_default.cardTitle,
|
|
831
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TerminalIcon, { className: DataAgentWorkbench_module_css_default.titleIcon }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("wb.sql") })]
|
|
850
|
+
})]
|
|
832
851
|
}),
|
|
833
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
834
|
-
className: DataAgentWorkbench_module_css_default.
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
852
|
+
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
853
|
+
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
854
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
855
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
856
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
857
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
858
|
+
children: t("form.user")
|
|
859
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
860
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
861
|
+
type: "text",
|
|
862
|
+
value: user,
|
|
863
|
+
disabled: formDisabled,
|
|
864
|
+
onChange: (event) => setUser(event.target.value)
|
|
865
|
+
})]
|
|
866
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
867
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
868
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
869
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
870
|
+
children: t("form.credentialMode")
|
|
871
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
872
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
873
|
+
value: credentialMode,
|
|
874
|
+
disabled: formDisabled,
|
|
875
|
+
onChange: (event) => {
|
|
876
|
+
const next = event.target.value;
|
|
877
|
+
setCredentialMode(next);
|
|
878
|
+
setCredentialStatus(void 0);
|
|
879
|
+
},
|
|
880
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
881
|
+
value: "password",
|
|
882
|
+
children: t("form.credentialMode.password")
|
|
883
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
884
|
+
value: "reference",
|
|
885
|
+
children: t("form.credentialMode.reference")
|
|
886
|
+
})]
|
|
887
|
+
})]
|
|
888
|
+
})]
|
|
846
889
|
}),
|
|
847
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("
|
|
848
|
-
className: DataAgentWorkbench_module_css_default.
|
|
890
|
+
!sqlite && credentialMode === "password" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
891
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
849
892
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
850
|
-
className: DataAgentWorkbench_module_css_default.
|
|
851
|
-
children: t("
|
|
852
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlayIcon, {}), sqlBusy ? t("wb.sql.running") : t("wb.sql.run")]
|
|
893
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
894
|
+
children: t("form.password")
|
|
895
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
896
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
897
|
+
type: "password",
|
|
898
|
+
value: password,
|
|
899
|
+
autoComplete: "new-password",
|
|
900
|
+
disabled: formDisabled,
|
|
901
|
+
onChange: (event) => setPassword(event.target.value)
|
|
860
902
|
})]
|
|
861
903
|
}),
|
|
862
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
863
|
-
className: DataAgentWorkbench_module_css_default.
|
|
864
|
-
children:
|
|
904
|
+
!sqlite && credentialMode === "password" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
905
|
+
className: DataAgentWorkbench_module_css_default.rememberRow,
|
|
906
|
+
children: [
|
|
907
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
908
|
+
type: "checkbox",
|
|
909
|
+
checked: rememberPassword,
|
|
910
|
+
disabled: formDisabled,
|
|
911
|
+
onChange: (event) => setRememberPassword(event.target.checked)
|
|
912
|
+
}),
|
|
913
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("form.rememberPassword") }),
|
|
914
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
915
|
+
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
916
|
+
children: t("form.rememberPassword.hint")
|
|
917
|
+
})
|
|
918
|
+
]
|
|
919
|
+
}),
|
|
920
|
+
!sqlite && credentialMode === "reference" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
921
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
922
|
+
children: [
|
|
923
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
924
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
925
|
+
children: t("form.passwordRef")
|
|
926
|
+
}),
|
|
927
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
928
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
929
|
+
type: "text",
|
|
930
|
+
value: passwordRef,
|
|
931
|
+
placeholder: "ANALYTICS_DB_PASSWORD",
|
|
932
|
+
disabled: formDisabled,
|
|
933
|
+
onChange: (event) => {
|
|
934
|
+
setPasswordRef(event.target.value);
|
|
935
|
+
setCredentialStatus(void 0);
|
|
936
|
+
}
|
|
937
|
+
}),
|
|
938
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
939
|
+
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
940
|
+
children: credentialStatus === void 0 ? t("form.passwordRef.hint") : credentialStatus.configured ? `${t("credential.configured")}${credentialStatus.source !== void 0 ? ` · ${credentialStatus.source}` : ""}` : t("credential.unconfigured")
|
|
941
|
+
})
|
|
942
|
+
]
|
|
943
|
+
}),
|
|
944
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
945
|
+
className: DataAgentWorkbench_module_css_default.rememberRow,
|
|
946
|
+
children: [
|
|
947
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
948
|
+
type: "checkbox",
|
|
949
|
+
checked: readonly,
|
|
950
|
+
disabled: formDisabled,
|
|
951
|
+
onChange: (event) => setReadonly(event.target.checked)
|
|
952
|
+
}),
|
|
953
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("form.readonly") }),
|
|
954
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
955
|
+
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
956
|
+
children: t("form.readonly.hint")
|
|
957
|
+
})
|
|
958
|
+
]
|
|
959
|
+
}),
|
|
960
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
961
|
+
className: DataAgentWorkbench_module_css_default.field,
|
|
962
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
963
|
+
className: DataAgentWorkbench_module_css_default.label,
|
|
964
|
+
children: databaseLabel
|
|
965
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
966
|
+
className: DataAgentWorkbench_module_css_default.input,
|
|
967
|
+
type: "text",
|
|
968
|
+
value: database,
|
|
969
|
+
placeholder: sqlite ? t("form.database.sqlite.placeholder") : void 0,
|
|
970
|
+
disabled: formDisabled,
|
|
971
|
+
onChange: (event) => setDatabase(event.target.value)
|
|
972
|
+
})]
|
|
865
973
|
})
|
|
866
974
|
]
|
|
867
|
-
})
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
975
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
976
|
+
className: DataAgentWorkbench_module_css_default.actions,
|
|
977
|
+
children: !connected ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
978
|
+
type: "button",
|
|
979
|
+
className: DataAgentWorkbench_module_css_default.primary,
|
|
980
|
+
disabled: busy || database === "" || !sqlite && host === "",
|
|
981
|
+
onClick: () => {
|
|
982
|
+
connect();
|
|
983
|
+
},
|
|
984
|
+
children: restoring ? t("state.reconnecting") : busy ? t("state.checking") : t("action.connect")
|
|
985
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
986
|
+
type: "button",
|
|
987
|
+
className: DataAgentWorkbench_module_css_default.ghost,
|
|
988
|
+
disabled: busy,
|
|
989
|
+
onClick: () => {
|
|
990
|
+
disconnect();
|
|
991
|
+
},
|
|
992
|
+
children: t("action.disconnect")
|
|
993
|
+
})
|
|
994
|
+
})]
|
|
995
|
+
}),
|
|
996
|
+
activeTab === "schema" && connected && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
997
|
+
id: `${tabsId}-schema-panel`,
|
|
998
|
+
role: "tabpanel",
|
|
999
|
+
"aria-labelledby": `${tabsId}-schema-tab`,
|
|
1000
|
+
className: `${DataAgentWorkbench_module_css_default.tabPanel} ${DataAgentWorkbench_module_css_default.schemaPanel}`,
|
|
888
1001
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
889
1002
|
className: DataAgentWorkbench_module_css_default.modalCol,
|
|
890
1003
|
children: [
|
|
@@ -899,7 +1012,7 @@ window.__ModuleLoader__.load({
|
|
|
899
1012
|
className: DataAgentWorkbench_module_css_default.treeScroll,
|
|
900
1013
|
children: [schemas.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
901
1014
|
className: DataAgentWorkbench_module_css_default.hint,
|
|
902
|
-
children: t("wb.loading")
|
|
1015
|
+
children: schemaBusy ? t("wb.loading") : t("wb.empty")
|
|
903
1016
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
904
1017
|
className: DataAgentWorkbench_module_css_default.tree,
|
|
905
1018
|
children: schemas.map((schema) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
@@ -980,251 +1093,62 @@ window.__ModuleLoader__.load({
|
|
|
980
1093
|
})
|
|
981
1094
|
})]
|
|
982
1095
|
})]
|
|
983
|
-
})
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
closeLabel: t("action.close"),
|
|
990
|
-
className: DataAgentWorkbench_module_css_default.connectModal,
|
|
991
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
992
|
-
className: DataAgentWorkbench_module_css_default.connectModalBody,
|
|
1096
|
+
}),
|
|
1097
|
+
activeTab === "sql" && connected && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
1098
|
+
id: `${tabsId}-sql-panel`,
|
|
1099
|
+
role: "tabpanel",
|
|
1100
|
+
"aria-labelledby": `${tabsId}-sql-tab`,
|
|
1101
|
+
className: `${DataAgentWorkbench_module_css_default.tabPanel} ${DataAgentWorkbench_module_css_default.sqlPanel}`,
|
|
993
1102
|
children: [
|
|
994
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
995
|
-
className: DataAgentWorkbench_module_css_default.
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
const next = event.target.value;
|
|
1008
|
-
setType(next);
|
|
1009
|
-
setPort(next === "postgres" ? "5432" : next === "mysql" ? "3306" : next === "oracle" ? "1521" : next === "hive" ? "10000" : next === "impala" ? "21050" : "");
|
|
1010
|
-
},
|
|
1011
|
-
children: [
|
|
1012
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1013
|
-
value: "mysql",
|
|
1014
|
-
children: t("type.mysql")
|
|
1015
|
-
}),
|
|
1016
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1017
|
-
value: "postgres",
|
|
1018
|
-
children: t("type.postgres")
|
|
1019
|
-
}),
|
|
1020
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1021
|
-
value: "sqlite",
|
|
1022
|
-
children: t("type.sqlite")
|
|
1023
|
-
}),
|
|
1024
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1025
|
-
value: "oracle",
|
|
1026
|
-
children: t("type.oracle")
|
|
1027
|
-
}),
|
|
1028
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1029
|
-
value: "hive",
|
|
1030
|
-
children: t("type.hive")
|
|
1031
|
-
}),
|
|
1032
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1033
|
-
value: "impala",
|
|
1034
|
-
children: t("type.impala")
|
|
1035
|
-
})
|
|
1036
|
-
]
|
|
1037
|
-
})]
|
|
1038
|
-
}),
|
|
1039
|
-
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1040
|
-
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
1041
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1042
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1043
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1044
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1045
|
-
children: t("form.host")
|
|
1046
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1047
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1048
|
-
type: "text",
|
|
1049
|
-
value: host,
|
|
1050
|
-
disabled: formDisabled,
|
|
1051
|
-
onChange: (event) => setHost(event.target.value)
|
|
1052
|
-
})]
|
|
1053
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1054
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1055
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1056
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1057
|
-
children: t("form.port")
|
|
1058
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1059
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1060
|
-
type: "number",
|
|
1061
|
-
min: 1,
|
|
1062
|
-
max: 65535,
|
|
1063
|
-
value: port,
|
|
1064
|
-
disabled: formDisabled,
|
|
1065
|
-
onChange: (event) => setPort(event.target.value)
|
|
1066
|
-
})]
|
|
1067
|
-
})]
|
|
1068
|
-
}),
|
|
1069
|
-
!sqlite && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1070
|
-
className: DataAgentWorkbench_module_css_default.fieldRow2,
|
|
1071
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1072
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1073
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1074
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1075
|
-
children: t("form.user")
|
|
1076
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1077
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1078
|
-
type: "text",
|
|
1079
|
-
value: user,
|
|
1080
|
-
disabled: formDisabled,
|
|
1081
|
-
onChange: (event) => setUser(event.target.value)
|
|
1082
|
-
})]
|
|
1083
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1084
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1085
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1086
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1087
|
-
children: t("form.credentialMode")
|
|
1088
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1089
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1090
|
-
value: credentialMode,
|
|
1091
|
-
disabled: formDisabled,
|
|
1092
|
-
onChange: (event) => {
|
|
1093
|
-
const next = event.target.value;
|
|
1094
|
-
setCredentialMode(next);
|
|
1095
|
-
setCredentialStatus(void 0);
|
|
1096
|
-
},
|
|
1097
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1098
|
-
value: "password",
|
|
1099
|
-
children: t("form.credentialMode.password")
|
|
1100
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1101
|
-
value: "reference",
|
|
1102
|
-
children: t("form.credentialMode.reference")
|
|
1103
|
-
})]
|
|
1104
|
-
})]
|
|
1105
|
-
})]
|
|
1106
|
-
}),
|
|
1107
|
-
!sqlite && credentialMode === "password" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1108
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1109
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1110
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1111
|
-
children: t("form.password")
|
|
1112
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1113
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1114
|
-
type: "password",
|
|
1115
|
-
value: password,
|
|
1116
|
-
autoComplete: "new-password",
|
|
1117
|
-
disabled: formDisabled,
|
|
1118
|
-
onChange: (event) => setPassword(event.target.value)
|
|
1119
|
-
})]
|
|
1120
|
-
}),
|
|
1121
|
-
!sqlite && credentialMode === "password" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1122
|
-
className: DataAgentWorkbench_module_css_default.rememberRow,
|
|
1123
|
-
children: [
|
|
1124
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1125
|
-
type: "checkbox",
|
|
1126
|
-
checked: rememberPassword,
|
|
1127
|
-
disabled: formDisabled,
|
|
1128
|
-
onChange: (event) => setRememberPassword(event.target.checked)
|
|
1129
|
-
}),
|
|
1130
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("form.rememberPassword") }),
|
|
1131
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1132
|
-
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
1133
|
-
children: t("form.rememberPassword.hint")
|
|
1134
|
-
})
|
|
1135
|
-
]
|
|
1136
|
-
}),
|
|
1137
|
-
!sqlite && credentialMode === "reference" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1138
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1139
|
-
children: [
|
|
1140
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1141
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1142
|
-
children: t("form.passwordRef")
|
|
1143
|
-
}),
|
|
1144
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1145
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1146
|
-
type: "text",
|
|
1147
|
-
value: passwordRef,
|
|
1148
|
-
placeholder: "ANALYTICS_DB_PASSWORD",
|
|
1149
|
-
disabled: formDisabled,
|
|
1150
|
-
onChange: (event) => {
|
|
1151
|
-
setPasswordRef(event.target.value);
|
|
1152
|
-
setCredentialStatus(void 0);
|
|
1153
|
-
}
|
|
1154
|
-
}),
|
|
1155
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1156
|
-
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
1157
|
-
children: credentialStatus === void 0 ? t("form.passwordRef.hint") : credentialStatus.configured ? `${t("credential.configured")}${credentialStatus.source !== void 0 ? ` · ${credentialStatus.source}` : ""}` : t("credential.unconfigured")
|
|
1158
|
-
})
|
|
1159
|
-
]
|
|
1160
|
-
}),
|
|
1161
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1162
|
-
className: DataAgentWorkbench_module_css_default.rememberRow,
|
|
1163
|
-
children: [
|
|
1164
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1165
|
-
type: "checkbox",
|
|
1166
|
-
checked: readonly,
|
|
1167
|
-
disabled: formDisabled,
|
|
1168
|
-
onChange: (event) => setReadonly(event.target.checked)
|
|
1169
|
-
}),
|
|
1170
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("form.readonly") }),
|
|
1171
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1172
|
-
className: DataAgentWorkbench_module_css_default.rememberHint,
|
|
1173
|
-
children: t("form.readonly.hint")
|
|
1174
|
-
})
|
|
1175
|
-
]
|
|
1176
|
-
}),
|
|
1177
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
1178
|
-
className: DataAgentWorkbench_module_css_default.field,
|
|
1179
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1180
|
-
className: DataAgentWorkbench_module_css_default.label,
|
|
1181
|
-
children: databaseLabel
|
|
1182
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1183
|
-
className: DataAgentWorkbench_module_css_default.input,
|
|
1184
|
-
type: "text",
|
|
1185
|
-
value: database,
|
|
1186
|
-
placeholder: sqlite ? t("form.database.sqlite.placeholder") : void 0,
|
|
1187
|
-
disabled: formDisabled,
|
|
1188
|
-
onChange: (event) => setDatabase(event.target.value)
|
|
1189
|
-
})]
|
|
1190
|
-
})
|
|
1191
|
-
]
|
|
1103
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
1104
|
+
className: DataAgentWorkbench_module_css_default.sqlInput,
|
|
1105
|
+
value: sql,
|
|
1106
|
+
rows: 9,
|
|
1107
|
+
spellCheck: false,
|
|
1108
|
+
placeholder: t("wb.sql.placeholder"),
|
|
1109
|
+
onChange: (event) => setSql(event.target.value),
|
|
1110
|
+
onKeyDown: (event) => {
|
|
1111
|
+
if ((event.metaKey || event.ctrlKey) && event.key === "Enter") {
|
|
1112
|
+
event.preventDefault();
|
|
1113
|
+
runSql();
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1192
1116
|
}),
|
|
1193
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1194
|
-
className: DataAgentWorkbench_module_css_default.
|
|
1195
|
-
children:
|
|
1117
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1118
|
+
className: DataAgentWorkbench_module_css_default.sqlActions,
|
|
1119
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1120
|
+
className: DataAgentWorkbench_module_css_default.shortcutHint,
|
|
1121
|
+
children: t("wb.sql.shortcut")
|
|
1122
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1196
1123
|
type: "button",
|
|
1197
1124
|
className: DataAgentWorkbench_module_css_default.primary,
|
|
1198
|
-
disabled:
|
|
1199
|
-
onClick: () => {
|
|
1200
|
-
connect();
|
|
1201
|
-
},
|
|
1202
|
-
children: restoring ? t("state.reconnecting") : busy ? t("state.checking") : t("action.connect")
|
|
1203
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1204
|
-
type: "button",
|
|
1205
|
-
className: DataAgentWorkbench_module_css_default.ghost,
|
|
1206
|
-
disabled: busy,
|
|
1125
|
+
disabled: sqlBusy || sql.trim() === "",
|
|
1207
1126
|
onClick: () => {
|
|
1208
|
-
|
|
1127
|
+
runSql();
|
|
1209
1128
|
},
|
|
1210
|
-
children: t("
|
|
1211
|
-
})
|
|
1212
|
-
}),
|
|
1213
|
-
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1214
|
-
className: DataAgentWorkbench_module_css_default.errorBar,
|
|
1215
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1216
|
-
className: DataAgentWorkbench_module_css_default.errorHead,
|
|
1217
|
-
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") })]
|
|
1218
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1219
|
-
className: DataAgentWorkbench_module_css_default.errorText,
|
|
1220
|
-
children: error
|
|
1129
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlayIcon, {}), sqlBusy ? t("wb.sql.running") : t("wb.sql.run")]
|
|
1221
1130
|
})]
|
|
1131
|
+
}),
|
|
1132
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
1133
|
+
className: DataAgentWorkbench_module_css_default.sqlResult,
|
|
1134
|
+
children: sqlResult ?? t("wb.sql.empty")
|
|
1222
1135
|
})
|
|
1223
1136
|
]
|
|
1137
|
+
}),
|
|
1138
|
+
error !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1139
|
+
className: DataAgentWorkbench_module_css_default.errorBar,
|
|
1140
|
+
role: "alert",
|
|
1141
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1142
|
+
className: DataAgentWorkbench_module_css_default.errorHead,
|
|
1143
|
+
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") })]
|
|
1144
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1145
|
+
className: DataAgentWorkbench_module_css_default.errorText,
|
|
1146
|
+
children: error
|
|
1147
|
+
})]
|
|
1224
1148
|
})
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
});
|
|
1149
|
+
]
|
|
1150
|
+
})
|
|
1151
|
+
})] });
|
|
1228
1152
|
}
|
|
1229
1153
|
const VIEW_KINDS = [
|
|
1230
1154
|
"metric",
|
|
@@ -42575,40 +42499,40 @@ window.__ModuleLoader__.load({
|
|
|
42575
42499
|
document.head.appendChild(tag);
|
|
42576
42500
|
}
|
|
42577
42501
|
var AnalysisDashboard_module_css_default = {
|
|
42578
|
-
"
|
|
42579
|
-
"
|
|
42580
|
-
"
|
|
42581
|
-
"
|
|
42582
|
-
"
|
|
42583
|
-
"
|
|
42584
|
-
"
|
|
42502
|
+
"metricBand": "_1tppBG_metricBand",
|
|
42503
|
+
"emptyText": "_1tppBG_emptyText",
|
|
42504
|
+
"modalSummary": "_1tppBG_modalSummary",
|
|
42505
|
+
"modalTitleWrap": "_1tppBG_modalTitleWrap",
|
|
42506
|
+
"empty": "_1tppBG_empty",
|
|
42507
|
+
"modalBody": "_1tppBG_modalBody",
|
|
42508
|
+
"metric": "_1tppBG_metric",
|
|
42585
42509
|
"modalTitle": "_1tppBG_modalTitle",
|
|
42510
|
+
"rowActions": "_1tppBG_rowActions",
|
|
42511
|
+
"rowButton": "_1tppBG_rowButton",
|
|
42512
|
+
"modalShell": "_1tppBG_modalShell",
|
|
42513
|
+
"table": "_1tppBG_table",
|
|
42514
|
+
"rowInterrupted": "_1tppBG_rowInterrupted",
|
|
42586
42515
|
"visuallyHidden": "_1tppBG_visuallyHidden",
|
|
42587
|
-
"
|
|
42588
|
-
"viewFull": "_1tppBG_viewFull",
|
|
42589
|
-
"modalHeader": "_1tppBG_modalHeader",
|
|
42516
|
+
"rowHead": "_1tppBG_rowHead",
|
|
42590
42517
|
"chartCanvas": "_1tppBG_chartCanvas",
|
|
42591
42518
|
"modal": "_1tppBG_modal",
|
|
42592
|
-
"
|
|
42593
|
-
"
|
|
42594
|
-
"modalBody": "_1tppBG_modalBody",
|
|
42595
|
-
"rowInterrupted": "_1tppBG_rowInterrupted",
|
|
42519
|
+
"tableWrap": "_1tppBG_tableWrap",
|
|
42520
|
+
"viewHalf": "_1tppBG_viewHalf",
|
|
42596
42521
|
"modalCount": "_1tppBG_modalCount",
|
|
42597
42522
|
"metricValue": "_1tppBG_metricValue",
|
|
42523
|
+
"rowTitle": "_1tppBG_rowTitle",
|
|
42524
|
+
"viewFull": "_1tppBG_viewFull",
|
|
42525
|
+
"modalClose": "_1tppBG_modalClose",
|
|
42526
|
+
"metricLabel": "_1tppBG_metricLabel",
|
|
42598
42527
|
"row": "_1tppBG_row",
|
|
42599
|
-
"
|
|
42600
|
-
"preview": "_1tppBG_preview",
|
|
42601
|
-
"rowError": "_1tppBG_rowError",
|
|
42528
|
+
"view": "_1tppBG_view",
|
|
42602
42529
|
"viewTitle": "_1tppBG_viewTitle",
|
|
42603
|
-
"emptyText": "_1tppBG_emptyText",
|
|
42604
|
-
"metric": "_1tppBG_metric",
|
|
42605
|
-
"modalShell": "_1tppBG_modalShell",
|
|
42606
|
-
"rowTitle": "_1tppBG_rowTitle",
|
|
42607
|
-
"empty": "_1tppBG_empty",
|
|
42608
|
-
"grid": "_1tppBG_grid",
|
|
42609
42530
|
"rowSummary": "_1tppBG_rowSummary",
|
|
42610
|
-
"
|
|
42611
|
-
"
|
|
42531
|
+
"chart": "_1tppBG_chart",
|
|
42532
|
+
"grid": "_1tppBG_grid",
|
|
42533
|
+
"preview": "_1tppBG_preview",
|
|
42534
|
+
"rowError": "_1tppBG_rowError",
|
|
42535
|
+
"modalHeader": "_1tppBG_modalHeader"
|
|
42612
42536
|
};
|
|
42613
42537
|
//#endregion
|
|
42614
42538
|
//#region src/client/AnalysisChart.tsx
|
|
@@ -43060,6 +42984,15 @@ window.__ModuleLoader__.load({
|
|
|
43060
42984
|
"state.disconnected": "未连接",
|
|
43061
42985
|
"state.checking": "正在检查连接…",
|
|
43062
42986
|
"state.reconnecting": "正在恢复连接…",
|
|
42987
|
+
"workbench.open.connected": "数据库工作台:已连接",
|
|
42988
|
+
"workbench.open.disconnected": "数据库工作台:未连接",
|
|
42989
|
+
"workbench.open.checking": "数据库工作台:正在检查连接",
|
|
42990
|
+
"workbench.open.error": "数据库工作台:连接异常",
|
|
42991
|
+
"composer.placeholder.disconnected": "数据库未连接,请点击输入框右上角的配置按钮",
|
|
42992
|
+
"composer.placeholder.connected": "数据库连接成功,请描述分析内容",
|
|
42993
|
+
"wb.workbench.title": "数据库工作台",
|
|
42994
|
+
"wb.workbench.description": "管理连接、浏览库表并运行 SQL",
|
|
42995
|
+
"wb.workbench.tabs": "数据库工作台功能",
|
|
43063
42996
|
"wb.schemas": "库",
|
|
43064
42997
|
"wb.tables": "表",
|
|
43065
42998
|
"wb.columns": "表结构",
|
|
@@ -43134,6 +43067,15 @@ window.__ModuleLoader__.load({
|
|
|
43134
43067
|
"state.disconnected": "Not connected",
|
|
43135
43068
|
"state.checking": "Checking connection…",
|
|
43136
43069
|
"state.reconnecting": "Restoring connection…",
|
|
43070
|
+
"workbench.open.connected": "Database workbench: connected",
|
|
43071
|
+
"workbench.open.disconnected": "Database workbench: not connected",
|
|
43072
|
+
"workbench.open.checking": "Database workbench: checking connection",
|
|
43073
|
+
"workbench.open.error": "Database workbench: connection error",
|
|
43074
|
+
"composer.placeholder.disconnected": "Database not connected. Click the configuration button at the top right of the input box.",
|
|
43075
|
+
"composer.placeholder.connected": "Database connected. Describe what you want to analyze.",
|
|
43076
|
+
"wb.workbench.title": "Database workbench",
|
|
43077
|
+
"wb.workbench.description": "Manage connections, browse schemas, and run SQL",
|
|
43078
|
+
"wb.workbench.tabs": "Database workbench sections",
|
|
43137
43079
|
"wb.schemas": "Databases",
|
|
43138
43080
|
"wb.tables": "Tables",
|
|
43139
43081
|
"wb.columns": "Columns",
|
|
@@ -43179,7 +43121,7 @@ window.__ModuleLoader__.load({
|
|
|
43179
43121
|
];
|
|
43180
43122
|
/**
|
|
43181
43123
|
* Client plugin body: register the data-agent dictionaries and the database
|
|
43182
|
-
* workbench into the composer
|
|
43124
|
+
* workbench trigger into the composer card's right control region. The registration rides the slot
|
|
43183
43125
|
* service's effect wrapper, so plugin unload removes it.
|
|
43184
43126
|
* @param ctx - client root context.
|
|
43185
43127
|
*/
|
|
@@ -43199,8 +43141,8 @@ window.__ModuleLoader__.load({
|
|
|
43199
43141
|
getSnapshot: () => list.getSnapshot(),
|
|
43200
43142
|
subscribe: (fn) => list.subscribe(fn)
|
|
43201
43143
|
};
|
|
43202
|
-
scope.slots.inject("conversation.input.
|
|
43203
|
-
name: "conversation.input.
|
|
43144
|
+
scope.slots.inject("conversation.input.right", () => scope.slots.register({
|
|
43145
|
+
name: "conversation.input.right",
|
|
43204
43146
|
id: "data-agent",
|
|
43205
43147
|
order: 0,
|
|
43206
43148
|
locale: NS,
|