mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-30 12:43:58 +00:00
SYNC: AI assistant
This commit is contained in:
committed by
Diflow
parent
de6acfa1ce
commit
a71129df4b
@@ -170,6 +170,9 @@
|
|||||||
import QueryAiAssistant from '../ai/QueryAiAssistant.svelte';
|
import QueryAiAssistant from '../ai/QueryAiAssistant.svelte';
|
||||||
import { getCurrentSettings } from '../stores';
|
import { getCurrentSettings } from '../stores';
|
||||||
import { Messages } from 'openai/resources/chat/completions';
|
import { Messages } from 'openai/resources/chat/completions';
|
||||||
|
import WidgetColumnBar from '../widgets/WidgetColumnBar.svelte';
|
||||||
|
import WidgetsInnerContainer from '../widgets/WidgetsInnerContainer.svelte';
|
||||||
|
import WidgetColumnBarItem from '../widgets/WidgetColumnBarItem.svelte';
|
||||||
|
|
||||||
export let tabid;
|
export let tabid;
|
||||||
export let conid;
|
export let conid;
|
||||||
@@ -791,6 +794,14 @@
|
|||||||
</VerticalSplitter>
|
</VerticalSplitter>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
<svelte:fragment slot="2">
|
<svelte:fragment slot="2">
|
||||||
|
<WidgetColumnBar>
|
||||||
|
<WidgetColumnBarItem
|
||||||
|
title={_t('query.AiAssistant', { defaultMessage: 'AI Assistant' })}
|
||||||
|
onClose={() => {
|
||||||
|
isAiAssistantVisible = false;
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<WidgetsInnerContainer skipDefineWidth flexContainer>
|
||||||
<QueryAiAssistant
|
<QueryAiAssistant
|
||||||
bind:this={domAiAssistant}
|
bind:this={domAiAssistant}
|
||||||
{conid}
|
{conid}
|
||||||
@@ -818,6 +829,9 @@
|
|||||||
}}
|
}}
|
||||||
{tabid}
|
{tabid}
|
||||||
/>
|
/>
|
||||||
|
</WidgetsInnerContainer>
|
||||||
|
</WidgetColumnBarItem>
|
||||||
|
</WidgetColumnBar>
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</HorizontalSplitter>
|
</HorizontalSplitter>
|
||||||
<svelte:fragment slot="toolstrip">
|
<svelte:fragment slot="toolstrip">
|
||||||
@@ -839,11 +853,17 @@
|
|||||||
},
|
},
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{queryRowsLimit ? _t('query.limitRows', { defaultMessage: 'Limit {queryRowsLimit} rows', values: { queryRowsLimit } }) : _t('query.unlimitedRows', { defaultMessage: 'Unlimited rows' })}</ToolStripButton
|
{queryRowsLimit
|
||||||
|
? _t('query.limitRows', { defaultMessage: 'Limit {queryRowsLimit} rows', values: { queryRowsLimit } })
|
||||||
|
: _t('query.unlimitedRows', { defaultMessage: 'Unlimited rows' })}</ToolStripButton
|
||||||
>
|
>
|
||||||
{/if}
|
{/if}
|
||||||
{#if resultCount == 1}
|
{#if resultCount == 1}
|
||||||
<ToolStripExportButton command="jslTableGrid.export" {quickExportHandlerRef} label={_t('export.result', { defaultMessage: 'Export result' })} />
|
<ToolStripExportButton
|
||||||
|
command="jslTableGrid.export"
|
||||||
|
{quickExportHandlerRef}
|
||||||
|
label={_t('export.result', { defaultMessage: 'Export result' })}
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<ToolStripDropDownButton
|
<ToolStripDropDownButton
|
||||||
menu={() =>
|
menu={() =>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
import { getLocalStorage, setLocalStorage } from '../utility/storageCache';
|
import { getLocalStorage, setLocalStorage } from '../utility/storageCache';
|
||||||
|
|
||||||
export let title;
|
export let title;
|
||||||
export let name;
|
|
||||||
export let skip = false;
|
export let skip = false;
|
||||||
export let positiveCondition = true;
|
export let positiveCondition = true;
|
||||||
export let height = null;
|
export let height = null;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
export let hideContent = false;
|
export let hideContent = false;
|
||||||
export let fixedWidth = 0;
|
export let fixedWidth = 0;
|
||||||
export let skipDefineWidth = false;
|
export let skipDefineWidth = false;
|
||||||
|
export let flexContainer = false;
|
||||||
|
|
||||||
export function scrollTop() {
|
export function scrollTop() {
|
||||||
domDiv.scrollTop = 0;
|
domDiv.scrollTop = 0;
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
on:drop
|
on:drop
|
||||||
bind:this={domDiv}
|
bind:this={domDiv}
|
||||||
class:hideContent
|
class:hideContent
|
||||||
|
class:flexContainer
|
||||||
class:leftFixedWidth={!fixedWidth && !skipDefineWidth}
|
class:leftFixedWidth={!fixedWidth && !skipDefineWidth}
|
||||||
data-testid={$$props['data-testid']}
|
data-testid={$$props['data-testid']}
|
||||||
style:width={fixedWidth ? `${fixedWidth}px` : undefined}
|
style:width={fixedWidth ? `${fixedWidth}px` : undefined}
|
||||||
@@ -35,4 +37,8 @@
|
|||||||
div.hideContent {
|
div.hideContent {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.flexContainer {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user